• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Managed Simconnect DLL failed to load

Messages
7
Country
ca-newbrunswick
While trying to do some testing with the FSX SDK in c#, I am unable to get the DLL to load. I received this error. While trying to find a cause for this error I was unable to find anything. Anyone have any ideas?

This is a c# winforms app in visual studio 2019.

Annotation 2020-08-02 100416.png
 
Have you set a reference to the dll in your project? I assume you have some code in Form1 that references the dll. If so you need a using in the form
 
You're missing the 'using LockheedMartin.Prepar3D.SimConnect' statement. You're possibly also missing the reference under Solution -> References -> Add Reference. Also, I have to ask: why are you instantiating a form instead of just using the designer?

Jon - I think this would possibly be better in the SimConnect forum.
 
You're missing the 'using LockheedMartin.Prepar3D.SimConnect' statement. You're possibly also missing the reference under Solution -> References -> Add Reference. Also, I have to ask: why are you instantiating a form instead of just using the designer?

Jon - I think this would possibly be better in the SimConnect forum.

Im using the FSX Steam Edition SDK Simconnect and yes a reference has been added and using statements have been added. The error happens when the form is loaded so when the DLL is loaded first.

Thanks,

Annotation 2020-08-09 093935.png
 
I see you have Any CPU set. Try x86.

I don't have FSX installed but it did get Prepar3D v 1.4 to work in VS 2019 compiled All the projects even C++ and VB. Download that and compare to FSX:SE. It doesn't run due not having P3D v1.4 installed.
1596983652852.png


edit: never mind SE is 64 bit right. Too many versions for my old brain to keep straight. :p

Edit2: Trying to research this FSX:SE is still 32 bit. Flight Sim World, a derivative, was 64 bit. So my suggestion is good.
 
Last edited:
That's another idea - take one of the early (32-bit) P3D samples and retarget it for FSX. When that works, strip out what you don't need and start adding you own stuff in. That's what I did when learning SimConnect, although in my case it was for P3Dv4. Hadn't bothered until then. Or just do that with an FSX example.
 
don't have FSX installed but it did get Prepar3D v 1.4 to work in VS 2019 compiled All the projects even C++ and VB. Download that and compare to FSX:SE. It doesn't run due not having P3D v1.4 installed.
Can you access FSX SE using Prepar3D v1.4 Simconnect?
 
Try this:

Cannot use .NET Framework 3.5 as the SDK references .NET Framework V4.0

"The primary reference "Microsoft.FlightSimulator.SimConnect, Version=10.0.61259.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0"
 
Lets restart:

You need the right SimConnect.dll which is here on my computer:

SimConnect_dll.png


And you need the Managed wrapper to SimConnect:

Managed_Wrapper_SimConnect_dll.png


Also, the P3D SimConnect won't help as it is for P3D. You need to have FSX SimConnect.
 
The error message indicates that the dotNet framework needs updating to 4.0 or above (current is 4.8). And - apologies. I wrote P3D originally but actually meant FSX. Muscle mermory...
 
Why not zip a folder with a small project that gives the error and attach it. Then we aren't making guesses that probably aren't right.
 
Here's a zipped file that contains the simplest of C# SimConnect projects. It just connects and disconnects by button press. It is using the RTM managed wrapper that uses the RTM SimConnect.dll (that's all version 2 of C#).

The app is written in C# v4.7x, and uses an alteration to the App.config file:

XML:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>
</configuration>

note: <startup useLegacyV2RuntimeActivationPolicy="true">

That's the magic.
 

Attachments

Alright. To further confuse the issue, FSX:SE ships with a gutted SDK, but within it's folder, there are the LegacyInterfaces managed Microsoft.FlightSimulator.SimConnect.dll, and the simconnect.msi to install the actual appropriate simconnect.dll

Also, there is a lib folder, containing a managed folder, containing the FSX:SE Microsoft.FlightSimulator.SimConnect.dll

I always assumed this was identical to the Acceleration version (XPack). But it is compiled as .NET 4.0 ANYCPU. So I would think if an app is for FSX:SE, it should compile as C# 4.x without problem.

Edit:

I can confirm that the app compiled with the SE wrapper, and compiled as ANYCPU does work, and the config file is not needed to run. It also appears to work with Dos Equis.
 
Last edited:
Here's a zipped file that contains the simplest of C# SimConnect projects. It just connects and disconnects by button press. It is using the RTM managed wrapper that uses the RTM SimConnect.dll (that's all version 2 of C#).

The app is written in C# v4.7x, and uses an alteration to the App.config file:

XML:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
    </startup>
</configuration>

note: <startup useLegacyV2RuntimeActivationPolicy="true">

That's the magic.

Hi!

This .zip just contains a windows shortcut for me (no files)... I wonder if you'd be able to check and re-upload if possible?

Thanks.
 
Back
Top