具体错误如下
Could not load file or assembly 'Microsoft.SqlServer.Replication, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.
在转移到另一个项目两个月后,我最近再次开始从事这个项目。它之前工作得很好,我已经仔细检查了所有引用资料。
最佳答案
answer by baldy以下是正确的,但您可能还需要在 AppPool 中启用 32 位应用程序。
在设置应用程序在我的本地机器上运行时(运行 Vista 64 位)我遇到了这个错误:
Could not load file or assembly
ChilkatDotNet2
or one of its dependencies. An attempt was made to load a program with an incorrect format.
显然,应用程序使用 ChilKat components , 但我们使用的版本似乎只是 32 位版本。
为了解决这个错误,我在 IIS 中设置了我的应用程序池以允许 32 位应用程序。 打开 IIS 管理器,右键单击应用程序池,然后选择高级设置(见下文)
然后将“启用 32 位应用程序”设置为 True。
全部完成!
关于c# - 我在 SQL Server 复制项目中收到 "An attempt was made to load a program with an incorrect format"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41449/