[英]MSBuild fail to build web site with reference a Bcl related library
I have 2 projects (.Net 4.0)我有 2 个项目(.Net 4.0)
The problem:问题:
I have searched around, including StackOverFlow.我四处搜索,包括 StackOverFlow。 But I can't find anything related to my scenario.
但是我找不到与我的场景相关的任何内容。
I tried:我试过:
(no code for this question) (这个问题没有代码)
My expectation:我的期望:
Update images更新图片
If I Right-Click on "WebSite2" -> Build web site, everything will be fine.如果我右键单击“WebSite2”-> 构建网站,一切都会好起来的。 But I want to use msbuild for automation job
但我想使用 msbuild 进行自动化工作
I can now reproduce same issue in my machine(details see #4594), since it has some difference from #5993 , I report it in msbuild
instead of dotnet cli
.我现在可以在我的机器上重现相同的问题(详细信息参见 #4594),因为它与#5993有一些不同,我在
msbuild
而不是dotnet cli
报告它。 Issue reported to Msbuild 4594 .问题已报告给Msbuild 4594 。
And a workaround which can work in command-line is to use devenv commands.可以在命令行中工作的解决方法是使用devenv命令。
But it requires us to install VS in build machine, then we can use devenv command
like:但是它需要我们在构建机器中安装VS ,然后我们可以使用
devenv command
例如:
Use the -Rebuild
switch can works well like what it behaves in VS.使用
-Rebuild
开关可以像它在 VS 中的行为一样工作。 See Remark1 .见备注1 。
In my opinion, if we build this specific solution in vs, it may make more actions behind than single msbuild.exe does.在我看来,如果我们在 vs 中构建这个特定的解决方案,它可能会比单个 msbuild.exe 执行更多的操作。 And that's why it works well in vs but not msbuild command-line.
这就是它在 vs 中运行良好但在 msbuild 命令行中运行良好的原因。
So if we need to automatically build this particular website in build server, we can try to use devenv command.(To see build output,it seems using devenv.com
is better than using devenv.exe
, see this )所以如果我们需要在构建服务器中自动构建这个特定的网站,我们可以尝试使用 devenv 命令。(要查看构建输出,似乎使用
devenv.com
比使用devenv.exe
更好,请参阅此)
Hope it makes some help and let's track the issue in 4594.希望它能有所帮助,让我们在 4594 中跟踪问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.