我收到以下错误:
error CS1704: An assembly with the same simple name 'Interop.xxx.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
我所看到的一切都表明我引用了两个同名的程序集,我需要删除其中一个。但是,我已经检查过并且只引用了一次。
这也仅在我使用 msbuild 从我的开发箱上的命令行构建时发生。如果我通过 Visual Studio 构建或在我们的 CI 服务器上进行干净构建,我不会看到此错误。
我已经尝试完全删除所有源代码并从头开始构建以更接近构建机器,但没有成功。
最佳答案
看来我今天没法读书了!
该项目有一个对 Interop 的引用和一个生成“相同”互操作的 COM 引用。所以有两个,我只是没有很好地搜索。我仍然不明白为什么它在其他地方有效,但这确实解决了问题。
关于c# - "An assembly with the same simple name has already been imported"没有重复引用的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3160634/