我试图使用c# 4.0编译我的excel插件,并在Visual Studio中构建我的项目时开始遇到这个问题。重要的是要告诉你,我以前从来没有遇到过这个问题。什么会导致这种情况发生?
当前回答
I recently hit this problem. In my case, I have NuGet packages on different assemblies. What I had was different versions of the same NuGet packages associated with my own assemblies. My solution was to use the NuGet package manager upon the Solution, as opposed to the individual projects. This enables a "consolidation" option, where you can upgrade your NuGet packages across as many projects as you want - so they all reference the same version of the assembly. When I did the consolidations, the build failure disappeared.
其他回答
我得到类似的编译器错误。一旦我将dll文件的依赖项目添加到解决方案中,问题就解决了。
就我而言,我将项目升级到。net 4.7.2,但仍然使用旧的visual studio版本(2015年)构建。 当我在VS 2019中构建项目时,构建失败消失了。
当我遇到这个问题时,我通过关闭“启用ClickOnce安全设置”来解决它。
菜单:项目|“项目名称”属性…|安全选项卡|“启用ClickOnce安全设置”复选框。
我也遇到了一些问题,我所要做的就是删除导致错误的.dll(可以在参考中找到),并重新添加它。
效果非常好。
请看这个答案。
转到发布页面,点击“应用程序文件”。从那里您应该会看到DLL的列表。确保那些给你带来麻烦的人的发布状态标记为“包括”而不是“先决条件”。
推荐文章
- 如何在c#中获得正确的时间戳
- Linq选择列表中存在的对象(A,B,C)
- c# .NET中的App.config是什么?如何使用它?
- c#:如何获得一个字符串的第一个字符?
- String类中的什么方法只返回前N个字符?
- 更好的方法将对象转换为int类型
- 我可以将c#字符串值转换为转义字符串文字吗?
- 在c#中转换char到int
- c#中朋友的对等物是什么?
- 关键字使用virtual+override vs. new
- 在ASP中选择Tag Helper。NET Core MVC
- 如何在没有任何错误或警告的情况下找到构建失败的原因
- 跨线程操作无效:控件“textBox1”从创建它的线程以外的线程访问
- Visual Studio弹出提示:“操作无法完成”
- 否ConcurrentList<T>在。net 4.0?