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

查看:27
本文介绍了“您是否缺少程序集参考?"编译错误 - 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天全站免登陆