-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
31 lines (29 loc) · 1.37 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!-- These targets apply to all projects in this directory -->
<Project>
<!-- Suppress warning CS0436 from generated AssemblyInfo.cs -->
<Target Condition="$(GenerateAssemblyInfo)=='true'" Name="FixAssemblyInfo" AfterTargets="GenerateAssemblyInfo">
<ReadLinesFromFile File="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="Lines" ItemName="Lines" />
</ReadLinesFromFile>
<WriteLinesToFile File="$(GeneratedAssemblyInfoFile)" Lines="#pragma warning disable CS0436" Overwrite="true" />
<WriteLinesToFile File="$(GeneratedAssemblyInfoFile)" Lines="@(Lines)" Overwrite="false" />
</Target>
<!-- Convert .pdb to .mdb for debugging -->
<Target Name="GenerateMdb" AfterTargets="Compile" Condition="'' != '$(Pdb2mdbPath)'">
<PropertyGroup>
<_Cmd>
"$(Pdb2mdbPath)" "@(IntermediateAssembly)"
</_Cmd>
</PropertyGroup>
<Exec Command="$(_Cmd)" Condition="Exists('@(IntermediateAssembly)')" />
</Target>
<!-- Tell MSBuild to copy the .mdb to downstream projects -->
<Target Name="ExportMdbToDependentProjects" BeforeTargets="BeforeBuild" Condition="'' != '$(Pdb2mdbPath)'">
<ItemGroup>
<Content Include="$(IntermediateOutputPath)$(TargetName).dll.mdb">
<Link>$(TargetName).dll.mdb</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Target>
</Project>