以下是我的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進行重建...這裏有詳細信息 –