在Windows Server 2008 R2 64位中构建的c# . net应用程序无法在Windows 7 32位中

本文关键字:Windows 应用程序 net 32位中 构建 2008 Server R2 64位 | 更新日期: 2023-09-27 18:11:19

我在Visual Studio 2012 Express中构建了一个应用程序,在Windows Server 2008R2 64位的c# . net 4.5上。当我编译时,我确保在构建属性中,平台目标设置为x86。

当我从发布文件夹复制文件到我的Windows 7 32时,它崩溃了。

系统抛出错误:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01:   fileupload.exe
Problem Signature 02:   1.0.0.0
Problem Signature 03:   53b63c5a
Problem Signature 04:   FileUpload
Problem Signature 05:   1.0.0.0
Problem Signature 06:   53b63c5a
Problem Signature 07:   c
Problem Signature 08:   6
Problem Signature 09:   System.IO.FileNotFoundException
OS Version: 6.1.7601.2.1.0.256.48
Locale ID:  1033
Additional Information 1:   0a9e
Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
Additional Information 3:   0a9e
Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

在Windows Server 2008 R2 64位中构建的c# . net应用程序无法在Windows 7 32位中

这是一个未找到文件的异常,可能像忘记复制文件或没有指定完整的路径名一样简单。

不要猜测,实现AppDomain.CurrentDomain.UnhandledException事件的处理程序并记录或显示e.ExceptionObject.ToString()的值。

我设法找到了解决这个问题的方法。进入解决方案资源管理器中的参考,对于每个项目,我确保将"Copy Local"属性设置为True。我最后在Release文件夹里有很多DLL文件,但它在Windows 7上运行。