“已经导入了具有相同简单名称的程序集"没有重复引用的错误 [英] "An assembly with the same simple name has already been imported" error without duplicate reference

查看:850
本文介绍了“已经导入了具有相同简单名称的程序集"没有重复引用的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下错误:

错误CS1704:具有相同简单名称的程序集 'Interop.xxx.dll,版本= 1.0.0.0,文化=中性, PublicKeyToken = null已被导入.尝试删除其中之一 引用或签名以使其并排启用.

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.

我所看到的所有内容都表明我要引用两个具有相同名称的程序集,并且需要删除其中之一.但是,我已经检查过,并且只引用了一次.

Everything I've seen says that I am referencing two assemblies with the same name and I need to remove one of them. However, I've checked and I'm only referencing it once.

这也仅在我使用msbuild从开发工具箱上的命令行进行构建时发生.如果我通过Visual Studio构建或在CI服务器上进行干净构建,则不会看到此错误.

This also only happens when I'm using msbuild to build from the command line on my dev box. If I build through Visual Studio or do a clean build on our CI server I don't see this error.

我尝试完全删除所有源代码并从头开始构建,以使其更类似于构建机器,但是没有运气.

I've tried completely removing all of my source and building from scratch to more closely resemble the build machine but no luck.

推荐答案

所以我今天好像看不懂!
该项目具有对Interop的引用和生成相同"互操作的COM引用.所以有两个,但我搜索的不是很好.我仍然不明白为什么它可以在其他地方使用,但这确实可以解决问题.

So it looks like I can't read today!
The project had a reference to the Interop and a COM reference that generated the "same" interop. So there were two and I just didn't search very well. I still don't understand why it worked in other places but this did fix it.

这篇关于“已经导入了具有相同简单名称的程序集"没有重复引用的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆