C# project migrated from .net framework 4.0 to 4.5 return error System.AccessViolationException

  • Thread starter Thread starter SauravSam
  • Start date Start date
S

SauravSam

Guest
I have a Windows Forms project built in C#, using .NET framework 4.0. The project was built in VS2010 in Windows 2008 R2.

This project uses functions written in C, which are used by the program through dll import. Everything was working fine in .Net Framework 4.0, I have a 32 bit and also a 64 bit version for this.

But, I recently had to migrate it to VS2015 with .Net Framework 4.7.2. The application in now being built in Windows 10.

The 32 bit application ran without any issues. No new prompts from Visual Studio while opening it in 2015 either.

But, the 64 bit application has some issues. The compilation and build was good. But when I try and use one of the C functions, it fails with the following error:


An unhandled exception of type 'System.AccessViolationException' occurred in XXXXX.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I tried to change the target framework to an older version and this problem starts right after .Net framework 4, so .Net Framework 5 also has this.

Any help would be really appreciated.

Thanks.

Continue reading...
 
Back
Top