Creating a new C# add-on with Visual Studio 2019[]
For this tutorial you can use the latest version of Visual Studio Community
Download and run the latest installer of Tacview: http://tacview.net/download
In Visual Studio 2019, create a new DLL project
Make sure everything is configured to build as 64-bit target (x64). Do not build for "Any CPU".
The following is an example of a build configuration (In VS, Build -> Configuration Manager) that should work if debugging in x64.
From C:\Program Files (x86)\Tacview\SDK\cs\, copy the folder Tacview.Wrapper into the folder of your new add-on.
Obtain the most recent version of DLLExport.bat from this GitHub repository: https://github.com/3F/DllExport And place it in your add-on folder.
Copy the text of C:\Program Files (x86)\Tacview\SDK\cs\HelloWorld\HelloWorld.DllInterface.cs to your add-on. Change the namespace as necessary.
Right-click on the solution to Add -> Existing Project -> Tacview.Wrapper -> project -> Windows -> Tacview.Wrapper.vcxproj
Run DllExport.bat in your add-on folder
Close Visual Studio if it is still open, and browse to the location of the solution of your add-on if a browsing window appears.
Make sure (x64) is selected, tick the Installed checkbox next to your Add-on and Apply.
Reload your project.
Add reference to Tacview Wrapper.
Right-click on your Project and select Properties to set the Output Path equal to C:\ProgramData\Tacview\AddOns\YourAddOn\
To debug your add-on, specify Tacview as the external program to start:
Troubleshooting[]
Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019[]
In the case that this error message appears in the log:
Make sure the latest version of Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 has been installed on this system:"https://support.microsoft.com/help/2977003" Make sure that you are not attempting to run a DEBUG version of this addon if you are not a developer. DEBUG builds require additional DLLs and tools.
First, use the link provided to download the latest version of Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019, even if you are sure that you have already downloaded everything your need. Close and re-launch Tacview.
If the error is still occurring it could be caused by the DLL having been compiled in DEBUG mode and now being run on a computer that is not set up for debugging. If you are the developer, be sure you are compiling the DLL in RELEASE mode. If you are not the developer, please contact the developer.
When I debug or throw exceptions in a .NET add-on, Tacview crashes.[]
Make sure you are running at least Tacview 1.9.3 beta 8 (or Tacview 1.9.3 stable), in which this issue is resolved. This issue occurs only on newer computers because it has to do with a security enhancement introduced in latest versions of Windows in combination with latest Intel and AMD processors.