[英]System.Data.SqlServerCe.dll is not a valid Win32 program
I am developing a C# program with visual studio that makes use of the sql compact library. 我正在使用Visual Studio开发使用SQL紧凑库的C#程序。 On the developing computer everything works like a charm but on my home computer that has an almost fresh win8 installment I get a System.BadImageFormatException: is not a valid win32 program and I have no clue why.
在正在开发的计算机上,所有东西都像魅力一样工作,但是在我的家用计算机上,几乎是全新的win8安装,我得到了System.BadImageFormatException:不是有效的win32程序,我也不知道为什么。
I have added the Microsoft.SqlServer.Compact package with nuget. 我已经使用nuget添加了Microsoft.SqlServer.Compact程序包。 this package includes the System.Data.SqlServerCe.dll.
此程序包包含System.Data.SqlServerCe.dll。
I have also seen on my development computer in the output window of visual studio that the System.Data.SqlServerCe.dll is loaded from GAC. 我还在Visual Studio输出窗口中的开发计算机上看到从GAC加载了System.Data.SqlServerCe.dll。 Since my home computer has a fersh win8 installment it does not have the System.Data.SqlServerCe.dll in its GAC but since I have added the Microsoft.SqlServer.Compact package with nuget that should not be problem right?
由于我的家用计算机安装了最新版本的win8,因此它的GAC中没有System.Data.SqlServerCe.dll,但是由于我添加了带有nuget的Microsoft.SqlServer.Compact程序包,这应该不是问题吧?
The problem is probably that your program or one of it's dependancies is 64 bit and you are running it on a 32-bit computer. 问题可能是您的程序或其依赖项之一是64位,并且您正在32位计算机上运行它。 Go to the project properties, and set the "platform target" to either "Any CPU" or "x86" if you are planning to run it on 32-bit systems.
转到项目属性,如果打算在32位系统上运行,则将“平台目标”设置为“任何CPU”或“ x86”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.