开发者

MS Build Error 3181- Problem with referenced assemblies

imagine the following scenario:

  • Assembly "Foo.dll" references the ADOX-Library (Microsoft ADO Ext. 2.8 for DDL and Security) which was added as Interop.ADOX.dll in the bin-directory by VS 2010. "Local copy" of this reference was set to true, too.

  • Assembly "Bar.exe" references both Foo.dll and additionally the ADOX-Library because some functionality from it is needed in Bar.exe

  • Both assemblies are signed

When "Local copy" of the ADOX-reference in Bar.exe is set to true as well, MS Build generates the warning 3181 - "Two or more files have the same target path" - which makes sense.

However, when I set "Local copy" of the ADOX-reference in Bar.exe to false, it compiles fine but upon startup of the application, an error is raised saying that the assembly Interop.ADOX could not be found and that the manifest definition of the assembly doesn't match the assembly reference.

I suppose I'm missing something rather simple here, but I was unable to solve my problem with Google. I'd be thankful for solutions 开发者_运维技巧or hints into the right direction :)

Cheers

Christian


Not sure why the EXE project didn't create the interop library. But punt this problem. Instead of having the EXE project reference ADO again, let it reference the interop library that was created by the DLL project.

Not exposing the ADO types in a public class would be the better solution. ADO Ext is a utility bag, you should be able to encapsulate it well enough.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜