Visual Studio Project依赖项 [英] Visual Studio Project dependencies

查看:210
本文介绍了Visual Studio Project依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio .Net解决方案,其中包含许多项目/库.

I have a Visual Studio .Net Solution which has many projects/libraries.

当我在自己的PC上本地工作时,没有问题,因为我倾向于重新编译那些刚更改的库,并且所有内容都是同步的.

When I work locally on my own PC there is no problem as I tend to recompile those libraries that I have just changed and everything is in sync.

问题有时是有时需要处理或查看我的代码的其他开发人员在重新编译所有内容时遇到了巨大的问题.

The problem is sometimes other developers who once in a while require to work on or look at my code have an enormous problem recompiling everything.

在配置管理器中,我没有检查所有项目,否则构建一切正常工作将花费很长时间.

In the configuration Manager, I do not have all projects checked else it would take too long to build everything whislt working.

问题是当解决方案在另一个应用程序上编译时,报告的一些错误表明某个特定的库有错误,并且它花了太长时间才能弄清单独编译每个库的所有依赖项.

Problem is when the solution is compiled on another application, some of the errors reported say a particular library has error and its taking too long to figure out all the dependencies compiling each one individually.

即使在配置管理器中检查了所有内容,它似乎仍无法正确编译.

Even when checking everything in the config manager it still does not seem to compile correctly.

我认为,当您添加对库的引用时,依赖项就得到了照顾.

I thought when you add a reference to a library the dependencies are taken care of.

是否有一种简单的方法来确保解决方案确定什么是正确的依赖项,并确保一切按正确的顺序构建?

Is there a simple way to make sure the solution determines what are the correct dependencies and make sure everything is built in the correct order?

谢谢

推荐答案

其他开发人员从您那里获得新的源代码后,他们应该关闭Visual Studio并重新打开解决方案.

After other developers got new source codes from you, they should close Visual Studio and reopen the solution.

有时,Visual Studio中的依赖项也有麻烦.首先,尝试以下菜单命令:

Sometimes there are also troubles with dependencies in Visual Studio. First, try these menu commands:

Build > Clean Solution
Build > Rebuild Solution

这将向您显示哪些依赖项是循环的或不正确的. 另外,在Visual Studio项目中,一定不要依赖于另一个创建可执行文件的项目(至少对于纯C ++编写的项目而言,这是正确的). IE.编译为"Utils.dll"的"Utils"项目不能依赖于"MyApp"项目,该项目导出一些功能或符号并编译为 both MyApp.exe和MyApp.lib(或其他某种部件).如果存在这种依赖性,则必须正确设置项目构建顺序,并手动在链接器输入中设置MyApp.lib.

This will show you which dependencies are cyclic or not correct. Also, in Visual Studio project must not depend on another one which creates executable (at least for our pure C++ -written project this is true). I.e. "Utils" project which compiles into "Utils.dll" cannot depend on "MyApp" project, which exports some functions or symbols and compiles into both MyApp.exe and MyApp.lib (or some other kind of assembly). If you have such a dependency, you must correctly setup project build order and manually set MyApp.lib as in linker inputs.

这篇关于Visual Studio Project依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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