在 VS2005 中强制重新加载引用的 .Net 组件 [英] Force reload of a referenced .Net component in VS2005

查看:59
本文介绍了在 VS2005 中强制重新加载引用的 .Net 组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 VB 项目,它加载对 .Net dll(我们也制作)的引用.两个项目正在同时开发.

We have a VB project that loads a reference to a .Net dll (which we also make). Both projects are being simultaneously developed.

当我们向引用的 dll 添加新类时,主项目通常不会注意到更改.

When we add new classes to the referenced dll, the main project normally fails to notice the changes.

也就是说,如果我们向 Foo dll 添加一个新类 Bar,我们应该能够输入Foo".并在智能感知下拉列表中列出 Bar.它永远不会存在.

That is, if we added a new class Bar to the Foo dll, we should be able to type "Foo." and have Bar listed in the intellisense dropdown. It's never there.

删除引用然后重新添加它有时会解决问题.有时我们已经能够手动输入 Bar,然后重建而不会出错.

Removing the reference and then adding it back in again sometimes fixes the problem. Sometimes we have been able to just manually type Bar in and then rebuild without errors.

在我看来,应该有某种方式告诉 Visual Studio 重新加载引用的项目,因为它已更改.实际上,我认为 VS 应该注意到更改本身,但是如果失败,我们需要一种简单的方法来强制重新加载.

It seems to me that there should be some way to tell Visual Studio to reload the referenced project because it has changed. Actually, I think VS should notice the change itself, but failing that, we need a simple way to force a reload.

有什么建议吗?

它是 VS2005,我们正在引用输出程序集(dll)

It is VS2005 and we are referencing output assemblies (the dll)

推荐答案

我曾经遇到过这个问题.将两个项目放入一个解决方案中.右键单击解决方案资源管理器中的解决方案,并设置构建顺序.使主项目依赖于 .DLL.现在,当您重新构建解决方案时,首先构建 .DLL,主项目将看到所有更改.

I had this problem once. Put both projects into a single solution. Right-click on the Solution in the Solution Explorer, and set the build order. Make the main project dependent on the .DLL. Now, when you rebuild the solution, the .DLL gets built first, and the main project will see all the changes.

此外,在选择引用时,将 .DLL 作为项目引用,而不是选择浏览.然后,更改应立即被主项目识别,无需重新构建.

Also, reference the .DLL as a Project instead of selecting Browse when choosing a reference. Then, the changes should be immediately recognized by the main project without rebuilding.

这篇关于在 VS2005 中强制重新加载引用的 .Net 组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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