以下是我的MSBuild XML。在BeforeBuild中生成的文件不包含在DLL中。我期待的文件包括在内。我注意到CoreBuild在BeforeBuild中被调用。如何重新生成包括生成的文件。将BeforeBuild中生成的文件包含到编译列表中
感谢
克里斯
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
...
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
...
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include=".\Resources\Assembly\*.dll" Condition="Exists('.\Resources\Assembly')" />
...
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include=".\**\*.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask TaskName="EdmTasks.ViewRefreshTask" AssemblyFile=".\Resources\Assembly\EdmTasks.dll" />
<Target Name="BeforeBuild">
<MsBuild Projects="ForwardPAS.csproj" Targets="CoreBuild" />
<ViewRefreshTask Assembly="$(TargetPath)" Lang="cs" DbContext="FranklinIndexedAnnuityDb" />
</Target>
</Project>
1.您将生成的程序集包含在将由CoreBuild构建的程序集中。 2.我们应该说CoreBuild依赖于BeforeBuild,这样MSBuild将不会并行地执行它们。 – Soundararajan
我的任务ViewRefreshTask需要CoreBuild发生......因为它使用DLL。然后它生成一个CS文件。我想要发生的是,生成的CS文件是否包含在项目中......因此,在BeforeBuild结束并且Build来了之后,现在将生成的文件构建到DLL中。 –
我添加了一个Task来运行MsBuild(Target:CoreBuild)到BeforeBuild进行重建...这里有详细信息 –