我使用 Visual Studio 2010 开发了一个 Windows 服务应用程序,以便集成两个应用程序。
在我的 WinService 中,我调用目标应用程序开发人员提供的一些 API DLL 文件,在从源应用程序获取信息后在目标应用程序中创建一些信息。
所以我的 Windows 服务就像一些中间件应用程序一样工作。
当我运行该服务时,我收到以下错误:
System.BadImageFormatException: Could not load file or assembly 'Interop.ErpBS800, Version=8.5.0.0, Culture=neutral, PublicKeyToken=e076e239d0e78a42' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Interop.ErpBS800, Version=8.5.0.0, Culture=neutral, PublicKeyToken=e076e239d0e78a42'
at MaeilKitWintouch.Primavera.CreateDocument(Facturas fac)
at MaeilKitWintouch.MaeilKitWintouch.ExecuteRequest()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
在我的 Windows 7 x86 笔记本电脑中,一切正常,但在 Windows Small Business Server 2011 Essentials 64 位中,我收到了该错误。
我有平台目标 = 任何 CPU 和目标框架 = .NET 4。