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

Create a new project-0.png
Configure your new project-0.png
Your new project.png

From C:\Program Files (x86)\Tacview\SDK\cs\, copy the folder Tacview.Wrapper and the files DllExport.bat and DllExport_Configure.bat to the folder of your new add-on.

Copy files FROM.png
Copy files TO.png

Copy the text of C:\Program Files (x86)\Tacview\SDK\cs\HelloWorld\HelloWorld.DllInterface.cs to your add-on.

Copy code FROM.png
Copy code TO.png

Right-click on the solution to Add -> Existing Project -> Tacview.Wrapper -> project -> Windows -> Tacview.Wrapper.vcxproj

Existing Project.png
Add Existing Project (Tacview Wrapper).png
Your Addon after adding Tacview Wrapper.png

Run DllExport_Configure.bat in your add-on folder

Run bat file.png
Running bat file.png

Tick the Installed checkbox next to your Add-on and apply.

Apply dat file.png

Reload your project.

Add reference to Tacview Wrapper.

Add reference.png

​​​​​​The following is an example of a build configuration (In VS, Build -> Configuration Manager) that should work if debugging in x64.

Configuration Manager-0.png

Right-click on your Project and select Properties to set the Output Path equal to C:\ProgramData\Tacview\AddOns\YourAddOn\

Output Path.png

Now just build your DLLand run Tacview to see it in action! (You'll have to close Tacview, build your add-on, then re-launch Tacview each time)

Troubleshooting

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.

Community content is available under CC-BY-SA unless otherwise noted.