Unity Di容器不能与64位版本一起使用

时间:2015-06-23 06:04:34

标签: wcf dependency-injection

我在WCF服务中使用Unity来加载组件。

我在下面提到的文章。

https://msdn.microsoft.com/en-us/library/vstudio/hh323725(v=vs.100).aspx

当我使用构建选项选项任何CPU在visual studio中构建服务时,服务正常工作。

由于一个第三方组件需要64位特定构建。所以我选择了64位构建选项。

我已经下载了Unity代码并构建了64位,但它也无法正常工作。

我接下来提到例外。

Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.


 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Common.Unity' could not be loaded.