复制到输出目录-devenv 2012 vs msbuild v4.0的不同行为 [英] copy to output directory - devenv 2012 vs msbuild v4.0 different behaviour

查看:99
本文介绍了复制到输出目录-devenv 2012 vs msbuild v4.0的不同行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图从devenv转到msbuild来编译大型项目.

但是我发现未对准.

这里有一个例子来重现它:

解决方案包含2个项目A.exe和B.dll.

A对B有依赖性(注意:不是引用,而是Visual Studio的依赖性集)

B包含带有复制到输出目录"的文件(textFile.txt). =始终

当我使用devenv进行编译时,解决方案:A的输出目录仅包含A.exe

当我使用msbuild编译解决方案时(未指定任何特定项目):A的输出目录将包含A.exe和textFile.txt

有人可以解释原因,以及是否有可能使msbuild行为与举止行为保持一致?

谢谢.

解决方案

您好,

请检查项目中有关Output目录的配置,以查看是否存在错误.

>> A对B有依赖性(注意:不是引用,而是Visual Studio的依赖性集)

我对此有疑问.如何设置项目依赖关系而不在它们之间进行引用?您是否在运行时使用反射来加载程序集?请发布更多有关您的方案的信息.没有足够的信息.

此致


Hi,

I'm trying to move from devenv to msbuild for compiling a large project.

However I found a misalignment.

Here an example to reproduce it:

Solution is containing 2 projects A.exe and B.dll.

A has a dependency on B (note: not a reference, just a dependency set from visual studio)

B contains a file (textFile.txt) with "Copy to Output directory" = Always

When I compile with devenv the solution: output directory of A will only contains A.exe

When I compile with msbuild the solution (without specifying any specific project): output directory of A will contain A.exe AND textFile.txt

Can someone explain why, and if it is possibe to align msbuild behaviour to devenv behaviour?

Thank you.

解决方案

Hello,

Please examine the configuration about Output directory in your project to see whether there is something incorrect.

>> A has a dependency on B (note: not a reference, just a dependency set from visual studio)

I have a question about it. How do you set project dependency without referencing between them? Do you use reflection at runtime to load assembly? Please post a bit more about your scenario. There is not enough information.

Regards,


这篇关于复制到输出目录-devenv 2012 vs msbuild v4.0的不同行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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