Workarounds.targets 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!-- 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. -->
  2. <Project>
  3. <!--
  4. Workaround https://github.com/aspnet/AspNetCore/issues/4257.
  5. The web sdk adds an implicit framework reference. This removes it until we can update our build to use framework references.
  6. -->
  7. <ItemGroup>
  8. <FrameworkReference Remove="Microsoft.AspNetCore.App" />
  9. <!-- Required because the Razor SDK will generate attributes -->
  10. <Reference Include="Microsoft.AspNetCore.Mvc" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' AND '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(GenerateRazorAssemblyInfo)' == 'true'" />
  11. </ItemGroup>
  12. <!-- Workaround https://github.com/dotnet/cli/issues/10528 -->
  13. <PropertyGroup>
  14. <BundledNETCorePlatformsPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
  15. </PropertyGroup>
  16. <!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. -->
  17. <!-- Workaround https://github.com/dotnet/source-build/issues/1112. Source link is currently disabled in source build so do not apply this worksaround. -->
  18. <Target Condition="'$(DotNetBuildFromSource)' != 'true'"
  19. Name="_EnsureSourceLinkHappensBeforeRazorComponentGeneration"
  20. BeforeTargets="PrepareForRazorComponentGenerate"
  21. DependsOnTargets="GenerateSourceLinkFile" />
  22. <!-- 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. -->
  23. <Import Condition="'$(DotNetBuildFromSource)' == 'true'" Project="WorkaroundsImported.targets" />
  24. <!-- Workaround for https://github.com/dotnet/arcade/issues/204, not needed in source build -->
  25. <ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
  26. <PackageReference Include="Internal.AspNetCore.BuildTasks" PrivateAssets="All" Version="$(InternalAspNetCoreBuildTasksPackageVersion)" IsImplicitlyDefined="true" />
  27. </ItemGroup>
  28. <!-- Workaround for netstandard2.1 projects until we can get a preview 8 SDK containing https://github.com/dotnet/sdk/pull/3463 fix. -->
  29. <ItemGroup>
  30. <KnownFrameworkReference Update="NETStandard.Library">
  31. <RuntimeFrameworkName>NETStandard.Library</RuntimeFrameworkName>
  32. </KnownFrameworkReference>
  33. </ItemGroup>
  34. <!-- Work around https://github.com/dotnet/cli/issues/11378. -->
  35. <Target Name="_WorkaroundNetStandard" AfterTargets="ResolvePackageAssets">
  36. <ItemGroup>
  37. <TransitiveFrameworkReference Remove="NETStandard.Library" />
  38. </ItemGroup>
  39. </Target>
  40. </Project>