MSBuild TargetOutputs 缺少程序集 [英] MSBuild TargetOutputs missing assemblies

查看:38
本文介绍了MSBuild TargetOutputs 缺少程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个解决方案文件,其代码类似于以下内容;

I am building a solution file with code similar to the following;

<Target Name="Build">
  <MSBuild Projects="$(MySolution)"
           Targets="Build"
           BuildInParallel="false"
           Properties="Configuration=$(Configuration);Platform=$(Platform);">     
    <Output ItemName="MyOutputs" TaskParameter="TargetOutputs"/>
  </MSBuild>

  <Message Importance="High" Text="MyOutputs=@(MyOutputs)" />
</Target>

并且该消息的输出应该显示已构建的程序集列表,但缺少一些项目 - 实际正在构建的项目(如在日志的其余部分中显示的那样).

And the output from that message that is supposed to show a list of assemblies that were built is missing some projects - projects that are actually being built (as they are shown being built in the rest of the log).

我在这些项目的解决方案文件中发现了一个明显的差异:他们每个人都有一个ProjectSection",而其他人没有.

例如,这个项目被发送到@(MyOutputs)

I found a descernible difference in the solution file regarding these projects: They each have a "ProjectSection" where others do not.

For example, this project is being sent to @(MyOutputs)

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Foo", "Foo\Foo.csproj", "{075C4960-951B-43FA-AAC5-99497C9C0EBC}"
EndProject

而这个不是:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bar", "Bar\Bar.csproj", "{EA7EEBE4-F7DB-4148-8B00-F49D747FA7B1}"
    ProjectSection(ProjectDependencies) = postProject
        {8B31D756-F858-43CA-81A7-5B4797554263} = {8B31D756-F858-43CA-81A7-5B4797554263}
    EndProjectSection
EndProject

有人愿意告诉我为什么会发生这种情况,或者删除这些 ProjectSections 的后果是什么?

Would someone care to enlighten me on why this is happening, or what the consequences of removing these ProjectSections are?

推荐答案

我发现我的问题是这样的

I found my issue was this

我是这样做的:

msbuild.exe myproject.vbproj /T:Rebuild
msbuild.exe myproject.vbproj /T:Package

VS 这个:

msbuild.exe myproject.vbproj /T:Rebuild;Package

我不知道为什么这行得通,或者为什么一开始就行不通.但希望能有所帮助.

I have no idea why this work or why it didn't in the first place. But hope that helps.

这篇关于MSBuild TargetOutputs 缺少程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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