“您是否缺少程序集参考?"编译错误-Visual Studio [英] "Are you missing an assembly reference?" compile error - Visual Studio

查看:111
本文介绍了“您是否缺少程序集参考?"编译错误-Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为公司中的其他应用程序开发服务器控件,以与WCF服务交互.每次更改代码并重新编译控件时,我都会将AsseemblyInfo.cs中的AssemblyVerison和AssemblyFileVersion类加1.例如,我的最新版本从1.0.07.0升级到1.0.08.0.

I am currently working on a server control for other applications in our company to interface with a WCF service. Every time I make a change code change and recompile the control, I increment the the AssemblyVerison and AssemblyFileVersion class in the AsseemblyInfo.cs by one. For example, my latest build went from 1.0.07.0 to 1.0.08.0.

使用方应用程序通过复制bin目录中的最新文件来更新文件并尝试进行编译时,会收到以下错误:

When the consuming application updates the file by copying the latest file in the bin directory and tries to compile, they receive the following error:

类型或名称空间名称"MyControl" 在命名空间中不存在 "MyNamespace"(您是否想念 程序集参考?)

The type or namespace name 'MyControl' does not exist in the namespace 'MyNamespace' (are you missing an assembly reference?)

为了解决此错误,他们必须删除当前引用,然后重新添加引用.

In order to resolve this error, they have to delete the current reference and re-add the reference.

有什么方法可以更新服务器控件,而不必删除并重新添加引用?

Is there any way to update the server control without having to delete and re-add the reference?

我对服务器控件的命名不是很严格.
@JPunyon-您的意思是说,正在使用的应用程序将服务器控制项目添加到其解决方案中吗?

I am not strong naming the server control.
@JPunyon - Do you mean have the consuming application add the server control project to their solution?

推荐答案

在解决方案资源管理器的属性中右键单击程序集引用,禁用特定版本"选项.

Right-click the assembly reference in the solution explorer, properties, disable the "Specific Version" option.

这篇关于“您是否缺少程序集参考?"编译错误-Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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