-C# App with simconnect
-App working ok on my pc, from Visual Studio 2019 and after compile and install in my pc, all work ok
-After installing it on any other pc and trying to start I get the error
-Same error that occurs in my pc if I delete simconnect.dll in app main folder with .exe file, but the file simconnect.dll is there in the main folder on the other pc too
Any ideas about that?
Error:
Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately
Could not load file or assembly âMicrosoft.FlightSimulator.SimConnect.dllâ or one of its dependencies. The specified module could not be found."
Err Details:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly âMicrosoft.FlightSimulator.SimConnect.dllâ or one of its dependencies. The specified module could not be found.
File name: âMicrosoft.FlightSimulator.SimConnect.dllâ
at MyApp.Form1.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Start by using the Fusion Log to see why the CLR canât bind to the assembly. That should give you enough information to understand what the problem is.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\usr1\source\repos\MyAppV1\MyApp\bin\x64\Release\MyApp.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/usr1/source/repos/MyAppV1/MyApp/bin/x64/Release/Microsoft.FlightSimulator.SimConnect.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\usr1\source\repos\MyAppV1\MyApp\bin\x64\Release\Microsoft.FlightSimulator.SimConnect.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.FlightSimulator.SimConnect, Version=11.0.62651.3, Culture=neutral, PublicKeyToken=null
LOG: Binding succeeds. Returns assembly from C:\Users\usr1\source\repos\MyAppV1\MyApp\bin\x64\Release\Microsoft.FlightSimulator.SimConnect.dll.
LOG: Assembly is loaded in default load context.
Since the CLR is binding to the interop assembly properly, the problem is likely due to one of the native dll dependencies not being found (or that simconnect.dll itself isnât getting found for some reason). Iâd start with using dumpbin /imports on the native simconnect.dll and see what dependencies it has and whether you can locate them. Alternatively, you can use gflags to take a Loader Snapshot to see what is going on. Because loader snaps can be large, you may want to test with a very simple C# application rather than your actual application.