大家好:搜遍了没找到答案,我是新手,请多多包涵。我有一个 MSBuild xml 文件,它应该在构建之前清除所有项目的 bin 和 obj 文件夹。同样,此构建文件设置(或应该)在编译项目时使用的参考路径。我遇到的问题是,当构建清除 bin 和 obj 文件夹时,没有一个项目使用引用路径 PropertyGroup 进行编译。正在设置的参考路径示例,以及一个项目的编译:
参考路径:
<Target Name="Compile" DependsOnTargets="GetLatest;CleanBinObj;CleanNetDLL">
<!-- Compile DLLs and Copy them to the Build Folder -->
<PropertyGroup>
<ThirdPartyAtalasoftDLLReferencePath>E:\Builds\Third Party\Atalasoft\10.0 - .NET 4.0\</ThirdPartyAtalasoftDLLReferencePath>
<ThirdPartyHylandDLLReferencePath>E:\Builds\Third Party\Hyland\</ThirdPartyHylandDLLReferencePath>
<ThirdPartyInfragisticsDLLReferencePath>E:\Builds\Third Party\Infragistics\12.1\</ThirdPartyInfragisticsDLLReferencePath>
<ThirdPartyMSOfficeDLLReferencePath>E:\Builds\Third Party\MS Office\</ThirdPartyMSOfficeDLLReferencePath>
<ThirdPartyMSSQLDLLReferencePath>E:\Builds\Third Party\MS SQL CE\</ThirdPartyMSSQLDLLReferencePath>
<ThirdPartyOtherDLLReferencePath>E:\Builds\Third Party\Other\</ThirdPartyOtherDLLReferencePath>
<ApplicationDLLBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Applications\</ApplicationDLLBuildPath>
<MiddlewareDLLBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Middleware\</MiddlewareDLLBuildPath>
<ComponentDLLBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Components\</ComponentDLLBuildPath>
<InterfaceDLLBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Interfaces\</InterfaceDLLBuildPath>
<TriggerProcessDLLBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Trigger Process\</TriggerProcessDLLBuildPath>
<WebOutPutBuildPath>E:\Builds\NetDLL\$(CodeBranch)\Web\</WebOutPutBuildPath>
</PropertyGroup>
<PropertyGroup>
<ReferencePath>
$(MiddlewareDLLBuildPath);
$(ComponentDLLBuildPath);
$(InterfaceDLLBuildPath);
$(ThirdPartyAtalasoftDLLReferencePath);
$(ThirdPartyHylandDLLReferencePath);
$(ThirdPartyInfragisticsDLLReferencePath);
$(ThirdPartyMSOfficeDLLReferencePath);
$(ThirdPartyMSSQLDLLReferencePath);
$(ThirdPartyOtherDLLReferencePath)
</ReferencePath>
</PropertyGroup>
项目编译:
<MSBuild Projects="..\MyProject\MyProject.csproj"
Properties="ReferencePath=$(ReferencePath)"></MSBuild>
这里的一切对我来说似乎都是正确的。如果需要更多代码来解决此问题,请告诉我。