在Visual Studio中卸载项目时,如何处理引用? [英] What do you do about references when unloading a project in Visual Studio?

查看:156
本文介绍了在Visual Studio中卸载项目时,如何处理引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在Visual Studio中卸载项目时,所有引用项目在其对卸载项目的引用上都会得到警告三角形.我已经为自己编写了一个宏以执行巧妙的工作(检测项目的添加/删除并将所有引用从-转换为文件/项目依赖项),但是我不相信自己没有缺少更简单的东西.如果我不得不手动更改引用,那么卸载功能又有什么用(这打破了个人解决方案/共享项目"团队的开发范式).

(此问题与此问题的答案关于在Visual Studio中构建大型解决方案-一些答案提到了解决方案包含很多项目,但是卸载"未使用的项目以提高性能.)

解决方案

我刚刚读过有关结构化解决方案和项目的MSDN文档.

我没有注意到的是,在多项目解决方案中,解决方案资源管理器中的上下文菜单会建议一个项目依赖项"弹出窗口.如果尚未通过项目之间的项目引用来定义项目依赖项,则可以在此处手动定义项目依赖项.

请参见此处(MSDN链接,所以几周后会自我毁灭)

When you unload a project in Visual Studio, any referencing projects get warning triangles on their reference to the unloaded project. I've written myself a macro to do clever stuff (detect add/remove of project and transform any references from-to file/project dependency), but I can't believe that I'm not missing something much simpler. How can the unload function be any use if I have to go around manually changing references (and it breaks the 'personal solutions/shared projects' team development paradigm).

(This question is related to answers to this question about structuring large solutions in Visual Studio - some answers mentioned having solutions with lots of projects, but 'unloading' unused projects to improve performance.)

解决方案

I've just had a eureka moment reading through MSDN doc on structuring solutions and projects.

What I hadn't noticed is that in a multi-project solution, the context menu in the Solution Explorer proposes a Project Dependencies popup. Here you can define the project dependencies manually, if you haven't defined them by project references between projects.

See here (MSDN link, so will self destruct after a few weeks)

这篇关于在Visual Studio中卸载项目时,如何处理引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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