Force reload of a referenced .Net component in VS2005

大兔子大兔子 提交于 2019-12-11 07:47:27

问题


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

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

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.

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.

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.

Any suggestions?

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


回答1:


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.

EDIT: 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.



来源:https://stackoverflow.com/questions/566297/force-reload-of-a-referenced-net-component-in-vs2005

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!