Using SimConnect SDK in Unity Project

Error code:

I am working on a project for which I would like to connect Microsoft Flight Simulator (MSFS 2020) with a Unity application. The goal is to get airplane coordinates out of the simulator and use them in Unity. There is a SDK called SimConnect, which allows to output and input sim variables.


I downloaded the SDK from the msfs2020 together with some sample projects written in C#. The key point is to have Microsoft.FlightSimulator.SimConnect.dll and SimConnect.dll in your project folder. There was one discussion on the FS Forum about integrating SimConnect into a Unity project.

Unfortunately there the problem was not solved. I tried all the steps recommended there. I copied the .dll files into the assets folder of my Unity project. When adding the Reference to the .dll in VS (ProjectAdd Reference) I was able to use the variables from the namespace until i opened Unity again, after that the namespace was not recognized anymore.


Additionally I tried to work with the CTrue.FsConnect NuGet package, but after installing it the same error was still present. On the CTrue.FsConnect GitHub there is an example code for C#. There the Microsoft.FlightSimulator.SimConnect.dll still needs to be imported, which leaves me with the same problem.


In Unity I put the settings of the project API Compatibility to .Net framework and build settings for x64. with Windows as a target platform. When opening the dll files in the inspector they are imported as native plugins and configured for windows x64 platform.

I am new to working with plugins in Unity, is anyone able to help?

Let me know what more information you need to better understand the problem. As I am new to this forum I was only allowed two hyperlinks.

help is really appreciated