gpt4 book ai didi

c# - "An assembly with the same simple name has already been imported"没有重复引用的错误

转载 作者:可可西里 更新时间:2023-11-01 07:46:48 24 4
gpt4 key购买 nike

我收到以下错误:

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com