我需要建立一个解决方案,但不包括一个项目。我怎么发动汽车呢?
我找了很多关于这个问题的东西,但是没有什么能帮上忙。
ItemGroup部分将引发以下异常:
无效元素。未知的任务或数据类型。
PropertyGroup也会出现例外情况。
下面是我的代码示例:
<project name="TI 8.1.6 build script">
<ItemGroup>
<Solution Include="${ROOT}\Core\TI Core.sln" Exclude="${ROOT}\Utilities\DTS Indexing Service\Tdi.Origami.IndexUpdaterServiceSetup\Tdi.Origami.IndexUpdaterServiceSetup.wixproj"/>
</ItemGroup>
...
</project>我该怎么做?
发布于 2012-03-19 22:46:52
可以通过在Visual中使用构建配置中的配置管理器对话框排除特定配置管理器对话框的解决方案级别的项目:

然后,只需在解决方案文件上调用msbuild,指定要使用的构建配置:
msbuild /property:Configuration=Release MySolution.sln发布于 2012-03-21 04:27:17
Enrico提出的解决方案是最通用的解决方案,可以一直工作。另一种解决方案可能是直接使用<MSBuild>任务。如果您将所有项目文件都放在特定的目录下,或者能够轻松地枚举您想要构建的所有项目(即解决方案中的项目数量不是很大),这将适用于您。
例如,此MSBuild文件将生成当前目录下的每个项目,但特定项目除外:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<MyProjectReferences Include="**\*.*proj" />
<MyProjectReferences Exclude="Utilities\DTS Indexing Service\Tdi.Origami.IndexUpdaterServiceSetup\Tdi.Origami.IndexUpdaterServiceSetup.wixproj" />
</ItemGroup>
<Target Name="BuildAllExceptWixProject">
<MSBuild Projects="@(MyProjectReferences)" Targets="Build" />
</Target>
</Project>然后,您可以使用命令行msbuild <myproject> /t:BuildAllExceptWixProject构建它。
发布于 2019-05-17 17:27:46
在解决方案文件(.sln)中,删除Build.0项。例如:
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyProject", "MyProject.vcxproj", "{2281D9E7-5261-433D-BB04-176A61500CA3}"
EndProject
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2281D9E7-5261-433D-BB04-176A61500CA3}.Debug|x86.Build.0 = Debug|x64如果删除这个"Build.0“条目,它将很好地加载解决方案,但不会通过GUI或通过外部MSBuild构建。
https://stackoverflow.com/questions/9778916
复制相似问题