2 ***********************************************************************************************
\r
3 Microsoft.NET.PreserveCompilationContext.targets
\r
5 WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
\r
6 created a backup copy. Incorrect changes to this file will make it
\r
7 impossible to load or build your projects from the command-line or the IDE.
\r
9 Copyright (c) .NET Foundation. All rights reserved.
\r
10 ***********************************************************************************************
\r
12 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
\r
15 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
\r
17 <RefAssembliesFolderName Condition="'$(RefAssembliesFolderName)' == ''">refs</RefAssembliesFolderName>
\r
20 <Target Name="ComputeDependencyFileCompilerOptions"
\r
21 Condition="'$(PreserveCompilationContext)' == 'true'"
\r
22 BeforeTargets="GenerateBuildDependencyFile;
\r
23 GeneratePublishDependencyFile">
\r
26 <DependencyFileCompilerOptions Include="CompilerOptions">
\r
27 <DefineConstants>$(DefineConstants)</DefineConstants>
\r
28 <LangVersion>$(LangVersion)</LangVersion>
\r
29 <PlatformTarget>$(PlatformTarget)</PlatformTarget>
\r
30 <AllowUnsafeBlocks>$(AllowUnsafeBlocks)</AllowUnsafeBlocks>
\r
31 <TreatWarningsAsErrors>$(TreatWarningsAsErrors)</TreatWarningsAsErrors>
\r
32 <Optimize>$(Optimize)</Optimize>
\r
33 <AssemblyOriginatorKeyFile>$(AssemblyOriginatorKeyFile)</AssemblyOriginatorKeyFile>
\r
34 <DelaySign>$(DelaySign)</DelaySign>
\r
35 <PublicSign>$(DelaySign)</PublicSign>
\r
36 <DebugType>$(DebugType)</DebugType>
\r
37 <OutputType>$(OutputType)</OutputType>
\r
38 <GenerateDocumentationFile>$(GenerateDocumentationFile)</GenerateDocumentationFile>
\r
39 </DependencyFileCompilerOptions>
\r
44 <Target Name="ComputeRefAssembliesToPublish"
\r
45 Condition="'$(PreserveCompilationContext)' == 'true'"
\r
46 AfterTargets="ComputeFilesToPublish"
\r
47 BeforeTargets="CopyFilesToPublishDirectory">
\r
51 Don't copy a compilation assembly if it's also a runtime assembly. There is no need to copy the same
\r
52 assembly to the 'refs' folder, if it is already in the publish directory.
\r
54 <ResolvedFileToPublish Include="@(ReferencePath)" Exclude="@(ResolvedAssembliesToPublish->'%(FullPath)')">
\r
55 <RelativePath>$(RefAssembliesFolderName)\%(Filename)%(Extension)</RelativePath>
\r
56 </ResolvedFileToPublish>
\r