Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Workarounds.targets « eng - github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75a53be31cc65e6cb1aafe6242be76a5c4307706 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. -->
<Project>
  <PropertyGroup>
    <DefaultNetCoreTargetFrameworkIdentifier>$([MSBuild]::GetTargetFrameworkIdentifier('$(DefaultNetCoreTargetFramework)'))</DefaultNetCoreTargetFrameworkIdentifier>
    <DefaultNetCoreTargetFrameworkVersion>v$([MSBuild]::GetTargetFrameworkVersion('$(DefaultNetCoreTargetFramework)', 2))</DefaultNetCoreTargetFrameworkVersion>

    <ProjectTargetFrameworkIdentifier>$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))</ProjectTargetFrameworkIdentifier>
    <ProjectTargetFrameworkVersion>v$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)', 2))</ProjectTargetFrameworkVersion>
  </PropertyGroup>

  <!--
    Workaround https://github.com/dotnet/aspnetcore/issues/4257.
    The web sdk adds an implicit framework reference. This removes it until we can update our build to use framework references.
  -->
  <ItemGroup>
    <FrameworkReference Remove="Microsoft.AspNetCore.App" Condition="'$(DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp)' != 'true'" />
    <!-- Required because the Razor SDK will generate attributes -->
    <Reference Include="Microsoft.AspNetCore.Mvc" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' AND
      '$(TargetFrameworkIdentifier)' == '$(NETCoreAppFrameworkIdentifier)' AND
      '$(GenerateRazorAssemblyInfo)' == 'true'" />
  </ItemGroup>

  <!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so define this dummy target which is required for pack. -->
  <Import Condition="'$(DotNetBuildFromSource)' == 'true'" Project="WorkaroundsImported.targets" />

  <!-- Workaround for netstandard2.1 projects until we can get a preview 8 SDK containing https://github.com/dotnet/sdk/pull/3463 fix. -->
  <ItemGroup>
    <KnownFrameworkReference Update="NETStandard.Library">
      <RuntimeFrameworkName>NETStandard.Library</RuntimeFrameworkName>
    </KnownFrameworkReference>
  </ItemGroup>

  <!-- Work around https://github.com/dotnet/cli/issues/11378. -->
  <Target Name="_WorkaroundNetStandard" AfterTargets="ResolvePackageAssets">
    <ItemGroup>
      <TransitiveFrameworkReference Remove="NETStandard.Library" />
    </ItemGroup>
  </Target>

  <!-- Work around https://github.com/dotnet/aspnetcore/issues/18393 -->
  <Target Name="_UpdateRazorGenerateAssemblyReferences"
          AfterTargets="ResolveAssemblyReferenceRazorGenerateInputs"
          DependsOnTargets="FindReferenceAssembliesForReferences"
          Condition="'$(CompileUsingReferenceAssemblies)' != 'false'">
    <ItemGroup>
      <RazorReferencePath Remove="@(ReferencePath)" />
      <RazorReferencePath Include="@(ReferencePathWithRefAssemblies)" />
    </ItemGroup>
  </Target>

  <!-- Work around https://github.com/dotnet/aspnetcore/issues/34048 -->
  <Target Name="_RemoveDuplicateLoggingSourceGenerator" AfterTargets="ResolvePackageAssets" Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' AND
      ('$(IsAspNetCoreApp)' == 'true' OR '$(UseAspNetCoreSharedRuntime)' == 'true')">
    <ItemGroup>
      <ResolvedAnalyzers Remove="@(ResolvedAnalyzers)" Condition="'%(ResolvedAnalyzers.NuGetPackageId)' == 'Microsoft.Extensions.Logging.Abstractions'" />
      <ResolvedAnalyzers Remove="@(ResolvedAnalyzers)" Condition="'%(ResolvedAnalyzers.NuGetPackageId)' == 'System.Text.Json'" />
    </ItemGroup>
  </Target>
</Project>