Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从.net framework 4.0迁移到4.5的c#项目返回错误System.AccessViolationException_C#_Visual Studio 2010_Visual Studio 2015_.net 4.0_.net 4.7.2 - Fatal编程技术网

从.net framework 4.0迁移到4.5的c#项目返回错误System.AccessViolationException

从.net framework 4.0迁移到4.5的c#项目返回错误System.AccessViolationException,c#,visual-studio-2010,visual-studio-2015,.net-4.0,.net-4.7.2,C#,Visual Studio 2010,Visual Studio 2015,.net 4.0,.net 4.7.2,我有一个用C#构建的Windows窗体项目,使用.NET framework 4.0。该项目建于VS2010年 该项目使用C语言编写的函数,程序通过DLL使用这些函数。在4.0中一切都很好,我有一个32位的版本,也有一个64位的版本 但是,我最近不得不使用.Net Framework 4.7.2将其迁移到VS2015 32位应用程序运行时没有任何问题。2015年打开Visual Studio时也没有新的提示 但是,64位应用程序存在一些问题。编译和构建都很好。但当我尝试使用其中一个C函数时,它失

我有一个用C#构建的Windows窗体项目,使用.NET framework 4.0。该项目建于VS2010年

该项目使用C语言编写的函数,程序通过DLL使用这些函数。在4.0中一切都很好,我有一个32位的版本,也有一个64位的版本

但是,我最近不得不使用.Net Framework 4.7.2将其迁移到VS2015

32位应用程序运行时没有任何问题。2015年打开Visual Studio时也没有新的提示

但是,64位应用程序存在一些问题。编译和构建都很好。但当我尝试使用其中一个C函数时,它失败了,出现以下错误:

ODT Admin.exe中发生类型为“System.AccessViolationException”的未处理异常

其他信息:尝试读取或写入受保护内存。这通常表示其他内存已损坏

我试图将目标框架更改为较旧的版本,而这个问题在.NETFramework4之后立即出现,所以.NETFramework5也有这个问题

任何帮助都将不胜感激


谢谢。

这篇文章可能会有帮助:抱歉,那篇文章只解释了如何处理这些异常,但我也需要用dll函数修复和执行我的代码。这篇文章可能会有帮助:抱歉,那篇文章只解释了如何处理这些异常,但我也需要用dll函数修复和执行我的代码。