I'm debugging a C# application crash. The crash is happening in a call to an external, native DLL.
Windows Event Log contains the following report. I'm targeting .NET 4.5 (in Visual Studio) and the target PC has .NET 4.5.2 installed.
My question is: why does Framework Version indicate v4.0.30319? This looks to me like the application is running under the wrong .NET framework.
Application: XXXXXXX.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at XXXXXXX.SVcamApi+NativeMethods.SVInterfaceGetDeviceId_64(Void*, UInt32, SByte*, UInt32*)
at XXXXXXX.SVcamApi+NativeMethods.SVInterfaceGetDeviceId_64(Void*, UInt32, SByte*, UInt32*)
at XXXXXXX.SVcamApi.SVS_InterfaceGetDeviceId(IntPtr, UInt32, System.String ByRef, UInt32 ByRef)
at XXXXXXX.XXXXXXX+Cameracontainer.deviceDiscovery()
at XXXXXXX.XXXXXXX.buttonDiscover_Click(System.Object, System.EventArgs)
at XXXXXXX.XXXXXXX.DiscoverAndConnect()
at XXXXXXX.XXXXXXX..ctor()
at XXXXXXX.Program.Main()
I've confirmed that 4.5.2 is installed using the Raymondcc .NET Detector utility: https://www.raymond.cc/blog/how-to-check-what-version-of-microsoft-net-framework-is-installed-in-computer/
Surprisingly, the .NET Detector indicates that 4.0 isn't even installed; it shows 2, 3, 3.5 and 4.5.2 as installed.