From 126f14dbd22fa76ee1e8dbd84fdd6a749c337e75 Mon Sep 17 00:00:00 2001
From: Pranav K <prkrishn@hotmail.com>
Date: Mon, 29 Jun 2020 11:36:59 -0700
Subject: [PATCH] Component package updates (#23371)

* Stop cross-compiling Component packages
* Remove Microsoft.JSInterop reference from M.A.Components
* Update RCL template

Fixes https://github.com/dotnet/aspnetcore/issues/23124
Fixes https://github.com/dotnet/aspnetcore/issues/23351
---
 ...AspNetCore.Components.Authorization.csproj | 10 ++-----
 ...AspNetCore.Components.Authorization.csproj |  4 +--
 .../Microsoft.AspNetCore.Components.csproj    | 13 ++--------
 .../Microsoft.AspNetCore.Components.csproj    | 16 +++---------
 ...t.AspNetCore.Components.multitarget.nuspec | 26 -------------------
 ...ft.AspNetCore.Components.netcoreapp.nuspec |  7 +++--
 .../src/Routing/RouteTableFactory.cs          |  4 +--
 ...crosoft.AspNetCore.Components.Forms.csproj | 10 ++-----
 ...crosoft.AspNetCore.Components.Forms.csproj |  7 +----
 ...Microsoft.AspNetCore.Components.Web.csproj | 13 ++--------
 ...Microsoft.AspNetCore.Components.Web.csproj |  3 +--
 ...oft.Authentication.WebAssembly.Msal.csproj |  3 +--
 .../Microsoft.JSInterop.WebAssembly.csproj    |  2 +-
 ...mponents.WebAssembly.Authentication.csproj |  3 +--
 ...t.AspNetCore.Components.WebAssembly.csproj |  6 ++---
 ...ft.AspNetCore.Components.WebAssembly.props |  5 ----
 .../StandaloneApp/StandaloneApp.csproj        |  2 +-
 .../TestApp/Wasm.Performance.TestApp.csproj   |  2 +-
 .../TestContentPackage.csproj                 |  3 +--
 .../ref/Microsoft.JSInterop.csproj            | 10 ++-----
 .../src/Microsoft.JSInterop.csproj            |  3 +--
 .../test/Microsoft.JSInterop.Tests.csproj     |  2 +-
 .../RazorClassLibrary-CSharp.csproj.in        |  5 +---
 23 files changed, 33 insertions(+), 126 deletions(-)
 delete mode 100644 src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec
 delete mode 100644 src/Components/WebAssembly/WebAssembly/src/build/netstandard2.0/Microsoft.AspNetCore.Components.WebAssembly.props

diff --git a/src/Components/Authorization/ref/Microsoft.AspNetCore.Components.Authorization.csproj b/src/Components/Authorization/ref/Microsoft.AspNetCore.Components.Authorization.csproj
index 53db4b90de5..238b4804b0a 100644
--- a/src/Components/Authorization/ref/Microsoft.AspNetCore.Components.Authorization.csproj
+++ b/src/Components/Authorization/ref/Microsoft.AspNetCore.Components.Authorization.csproj
@@ -1,15 +1,9 @@
 <!-- This file is automatically generated. -->
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <Compile Include="Microsoft.AspNetCore.Components.Authorization.netstandard2.0.cs" />
-    <Reference Include="Microsoft.AspNetCore.Authorization" />
-    <Reference Include="Microsoft.AspNetCore.Components" />
-  </ItemGroup>
-<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
     <Compile Include="Microsoft.AspNetCore.Components.Authorization.netcoreapp.cs" />
     <Reference Include="Microsoft.AspNetCore.Authorization" />
     <Reference Include="Microsoft.AspNetCore.Components" />
diff --git a/src/Components/Authorization/src/Microsoft.AspNetCore.Components.Authorization.csproj b/src/Components/Authorization/src/Microsoft.AspNetCore.Components.Authorization.csproj
index fa9f6827720..9cf597d035e 100644
--- a/src/Components/Authorization/src/Microsoft.AspNetCore.Components.Authorization.csproj
+++ b/src/Components/Authorization/src/Microsoft.AspNetCore.Components.Authorization.csproj
@@ -1,12 +1,10 @@
 <Project Sdk="Microsoft.NET.Sdk.Razor">
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <Description>Authentication and authorization support for Blazor applications.</Description>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
-    <RazorLangVersion>3.0</RazorLangVersion>
   </PropertyGroup>
 
   <ItemGroup>
diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.csproj b/src/Components/Components/ref/Microsoft.AspNetCore.Components.csproj
index c09fdf223f4..a5dade5e0b7 100644
--- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.csproj
+++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.csproj
@@ -1,19 +1,10 @@
 <!-- This file is automatically generated. -->
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <Nullable>annotations</Nullable>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <Compile Include="Microsoft.AspNetCore.Components.netstandard2.0.cs" />
-    <Compile Include="Microsoft.AspNetCore.Components.Manual.cs" />
-    <Compile Include="../src/Properties/AssemblyInfo.cs" />
-    <Reference Include="Microsoft.Extensions.Logging.Abstractions" />
-    <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
-    <Reference Include="System.Buffers" />
-  </ItemGroup>
-<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
     <Compile Include="Microsoft.AspNetCore.Components.netcoreapp.cs" />
     <Compile Include="Microsoft.AspNetCore.Components.Manual.cs" />
     <Compile Include="../src/Properties/AssemblyInfo.cs" />
diff --git a/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj b/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj
index 30e1ef833a9..1e7f881ed50 100644
--- a/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj
+++ b/src/Components/Components/src/Microsoft.AspNetCore.Components.csproj
@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Components feature for ASP.NET Core.</Description>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
@@ -16,19 +15,12 @@
   <ItemGroup>
     <Reference Include="Microsoft.Extensions.Logging.Abstractions" />
     <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
-
-    <Compile Include="$(SharedSourceRoot)HashCodeCombiner\*.cs" />
-  </ItemGroup>
-
-  <ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
-    <Reference Include="System.Buffers" />
   </ItemGroup>
 
   <!-- These references were removed in 3.0 -->
   <ItemGroup>
     <SuppressBaselineReference Include="Microsoft.AspNetCore.Components.Analyzers" />
     <SuppressBaselineReference Include="Microsoft.AspNetCore.Authorization" />
-    <SuppressBaselineReference Include="Microsoft.JSInterop" />
     <SuppressBaselineReference Include="System.ComponentModel.Annotations" />
   </ItemGroup>
 
@@ -37,27 +29,25 @@
         BuildInParallel="$(BuildInParallel)"
         Projects="
           ../../Analyzers/src/Microsoft.AspNetCore.Components.Analyzers.csproj;
-          ../../../JSInterop/Microsoft.JSInterop/src/Microsoft.JSInterop.csproj;
           ../../../Security/Authorization/Core/src/Microsoft.AspNetCore.Authorization.csproj">
       <Output TaskParameter="TargetOutputs" ItemName="_ProjectPathWithVersion" />
     </MSBuild>
     <ItemGroup>
       <NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Components.Analyzers')->'componentAnalyzerPackageVersion=%(PackageVersion)')" />
       <NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.AspnetCore.Authorization')->'authorizationPackageVersion=%(PackageVersion)')" />
-      <NuspecProperty Include="@(_ProjectPathWithVersion->WithMetadataValue('PackageId', 'Microsoft.JSInterop')->'jsInteropPackageVersion=%(PackageVersion)')" />
     </ItemGroup>
   </Target>
 
   <!-- Pack settings -->
   <PropertyGroup>
-    <NuspecFile>Microsoft.AspNetCore.Components.multitarget.nuspec</NuspecFile>
-    <NuspecFile Condition="'$(DotNetBuildFromSource)' == 'true'">Microsoft.AspNetCore.Components.netcoreapp.nuspec</NuspecFile>
+    <NuspecFile>Microsoft.AspNetCore.Components.netcoreapp.nuspec</NuspecFile>
     <GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);_GetNuspecDependencyPackageVersions</GenerateNuspecDependsOn>
   </PropertyGroup>
 
   <ItemGroup>
     <NuspecProperty Condition="'$(DotNetBuildFromSource)' != 'true'" Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
     <NuspecProperty Include="AssemblyName=$(AssemblyName)" />
+    <NuspecProperty Include="DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework)" />
     <NuspecProperty Include="OutputPath=$(OutputPath)" />
     <NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
   </ItemGroup>
diff --git a/src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec b/src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec
deleted file mode 100644
index dec35ae1731..00000000000
--- a/src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
-  <metadata>
-    $CommonMetadataElements$
-    <dependencies>
-      <group targetFramework=".NETStandard2.0">
-        <dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
-        <dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
-        <dependency id="System.ComponentModel.Annotations" version="$systemComponentModelAnnotationsPackageVersion$" exclude="Build,Analyzers" />
-      </group>
-      <group targetFramework=".net5.0">
-        <dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
-        <dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
-      </group>
-    </dependencies>
-  </metadata>
-  <files>
-    $CommonFileElements$
-    <file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
-    <file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
-    <file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
-    <file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
-  </files>
-</package>
diff --git a/src/Components/Components/src/Microsoft.AspNetCore.Components.netcoreapp.nuspec b/src/Components/Components/src/Microsoft.AspNetCore.Components.netcoreapp.nuspec
index ffd63e9b693..6891e553c98 100644
--- a/src/Components/Components/src/Microsoft.AspNetCore.Components.netcoreapp.nuspec
+++ b/src/Components/Components/src/Microsoft.AspNetCore.Components.netcoreapp.nuspec
@@ -6,15 +6,14 @@
       <group targetFramework=".net5.0">
         <dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$componentAnalyzerPackageVersion$" />
         <dependency id="Microsoft.AspNetCore.Authorization" version="$authorizationPackageVersion$" exclude="Build,Analyzers" />
-        <dependency id="Microsoft.JSInterop" version="$jsInteropPackageVersion$" exclude="Build,Analyzers" />
       </group>
     </dependencies>
   </metadata>
   <files>
     $CommonFileElements$
-    <file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
-    <file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
-    <file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
+    <file src="$OutputPath$$AssemblyName$.dll" target="lib\$DefaultNetCoreTargetFramework$\" />
+    <file src="$OutputPath$$AssemblyName$.pdb" target="lib\$DefaultNetCoreTargetFramework$\" />
+    <file src="$OutputPath$$AssemblyName$.xml" target="lib\$DefaultNetCoreTargetFramework$\" />
     <file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
   </files>
 </package>
diff --git a/src/Components/Components/src/Routing/RouteTableFactory.cs b/src/Components/Components/src/Routing/RouteTableFactory.cs
index d1e2991f5fb..4f66d660f7b 100644
--- a/src/Components/Components/src/Routing/RouteTableFactory.cs
+++ b/src/Components/Components/src/Routing/RouteTableFactory.cs
@@ -221,7 +221,7 @@ namespace Microsoft.AspNetCore.Components
 
             public override int GetHashCode()
             {
-                var hash = new HashCodeCombiner();
+                var hash = new HashCode();
 
                 if (Assemblies != null)
                 {
@@ -231,7 +231,7 @@ namespace Microsoft.AspNetCore.Components
                     }
                 }
 
-                return hash;
+                return hash.ToHashCode();
             }
         }
     }
diff --git a/src/Components/Forms/ref/Microsoft.AspNetCore.Components.Forms.csproj b/src/Components/Forms/ref/Microsoft.AspNetCore.Components.Forms.csproj
index ce5bb3e814f..6186022f8af 100644
--- a/src/Components/Forms/ref/Microsoft.AspNetCore.Components.Forms.csproj
+++ b/src/Components/Forms/ref/Microsoft.AspNetCore.Components.Forms.csproj
@@ -1,16 +1,10 @@
 <!-- This file is automatically generated. -->
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <Nullable>annotations</Nullable>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <Compile Include="Microsoft.AspNetCore.Components.Forms.netstandard2.0.cs" />
-    <Reference Include="Microsoft.AspNetCore.Components" />
-    <Reference Include="System.ComponentModel.Annotations" />
-  </ItemGroup>
-<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
     <Compile Include="Microsoft.AspNetCore.Components.Forms.netcoreapp.cs" />
     <Reference Include="Microsoft.AspNetCore.Components" />
   </ItemGroup>
diff --git a/src/Components/Forms/src/Microsoft.AspNetCore.Components.Forms.csproj b/src/Components/Forms/src/Microsoft.AspNetCore.Components.Forms.csproj
index 51d866333dc..05b13e543b5 100644
--- a/src/Components/Forms/src/Microsoft.AspNetCore.Components.Forms.csproj
+++ b/src/Components/Forms/src/Microsoft.AspNetCore.Components.Forms.csproj
@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <Description>Forms and validation support for Blazor applications.</Description>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -13,8 +12,4 @@
     <Reference Include="Microsoft.AspNetCore.Components" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'" >
-    <Reference Include="System.ComponentModel.Annotations" />
-  </ItemGroup>
-
 </Project>
diff --git a/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.csproj b/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.csproj
index e472ff807eb..5ea34c6c96e 100644
--- a/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.csproj
+++ b/src/Components/Web/ref/Microsoft.AspNetCore.Components.Web.csproj
@@ -1,19 +1,10 @@
 <!-- This file is automatically generated. -->
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <Nullable>annotations</Nullable>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <Compile Include="Microsoft.AspNetCore.Components.Web.netstandard2.0.cs" />
-    <Compile Include="../src/Properties/AssemblyInfo.cs" />
-    <Reference Include="Microsoft.AspNetCore.Components" />
-    <Reference Include="Microsoft.AspNetCore.Components.Forms" />
-    <Reference Include="Microsoft.Extensions.DependencyInjection" />
-    <Reference Include="Microsoft.JSInterop" />
-  </ItemGroup>
-<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
     <Compile Include="Microsoft.AspNetCore.Components.Web.netcoreapp.cs" />
     <Compile Include="../src/Properties/AssemblyInfo.cs" />
     <Reference Include="Microsoft.AspNetCore.Components" />
diff --git a/src/Components/Web/src/Microsoft.AspNetCore.Components.Web.csproj b/src/Components/Web/src/Microsoft.AspNetCore.Components.Web.csproj
index 91e82337640..39db3a0be97 100644
--- a/src/Components/Web/src/Microsoft.AspNetCore.Components.Web.csproj
+++ b/src/Components/Web/src/Microsoft.AspNetCore.Components.Web.csproj
@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <IsAspNetCoreApp>true</IsAspNetCoreApp>
     <Description>Support for rendering ASP.NET Core components for browsers.</Description>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
diff --git a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
index 09b63f4ed39..4b27caa77b8 100644
--- a/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
+++ b/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj
@@ -3,9 +3,8 @@
   <Sdk Name="Yarn.MSBuild" />
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Authenticate your Blazor webassembly applications with Azure Active Directory and Azure Active Directory B2C</Description>
-    <RazorLangVersion>3.0</RazorLangVersion>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
   </PropertyGroup>
 
diff --git a/src/Components/WebAssembly/JSInterop/src/Microsoft.JSInterop.WebAssembly.csproj b/src/Components/WebAssembly/JSInterop/src/Microsoft.JSInterop.WebAssembly.csproj
index 02e31b41b5c..8b58eb02dd6 100644
--- a/src/Components/WebAssembly/JSInterop/src/Microsoft.JSInterop.WebAssembly.csproj
+++ b/src/Components/WebAssembly/JSInterop/src/Microsoft.JSInterop.WebAssembly.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Abstractions and features for interop between .NET WebAssembly and JavaScript code.</Description>
     <PackageTags>wasm;javascript;interop</PackageTags>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
diff --git a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
index e95a6956851..dbc2d3a1a8b 100644
--- a/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
+++ b/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj
@@ -3,10 +3,9 @@
   <Sdk Name="Yarn.MSBuild" />
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Build client-side authentication for single-page applications (SPAs).</Description>
     <IsShippingPackage>true</IsShippingPackage>
-    <RazorLangVersion>3.0</RazorLangVersion>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
   </PropertyGroup>
 
diff --git a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
index 2aab0dbca72..3ca9477b3e2 100644
--- a/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
+++ b/src/Components/WebAssembly/WebAssembly/src/Microsoft.AspNetCore.Components.WebAssembly.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.1</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Build client-side single-page applications (SPAs) with Blazor running under WebAssembly.</Description>
     <IsShippingPackage>true</IsShippingPackage>
     <NoWarn>$(NoWarn);BL0006</NoWarn>
@@ -49,7 +49,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <Content Include="$(BlazorWebAssemblyJSFile)" Pack="true" PackagePath="build\netstandard2.0\" LinkBase="build\netstandard2.0\" />
-    <Content Include="build\netstandard2.0\*.props" Pack="true" PackagePath="build\netstandard2.0\" />
+    <Content Include="$(BlazorWebAssemblyJSFile)" Pack="true" PackagePath="build\net5.0\" LinkBase="build\net5.0\" />
+    <Content Include="build\net5.0\*.props" Pack="true" PackagePath="build\net5.0\" />
   </ItemGroup>
 </Project>
diff --git a/src/Components/WebAssembly/WebAssembly/src/build/netstandard2.0/Microsoft.AspNetCore.Components.WebAssembly.props b/src/Components/WebAssembly/WebAssembly/src/build/netstandard2.0/Microsoft.AspNetCore.Components.WebAssembly.props
deleted file mode 100644
index 41ae67bf352..00000000000
--- a/src/Components/WebAssembly/WebAssembly/src/build/netstandard2.0/Microsoft.AspNetCore.Components.WebAssembly.props
+++ /dev/null
@@ -1,5 +0,0 @@
-<Project>
-  <PropertyGroup>
-    <BlazorWebAssemblyJSPath>$(MSBuildThisFileDirectory)blazor.webassembly.js</BlazorWebAssemblyJSPath>
-  </PropertyGroup>
-</Project>
diff --git a/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj b/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj
index 9ebf31c365f..77733924cd5 100644
--- a/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj
+++ b/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>net5.0</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
     <UseBlazorWebAssembly>true</UseBlazorWebAssembly>
     <FixupWebAssemblyHttpHandlerReference>true</FixupWebAssemblyHttpHandlerReference>
diff --git a/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj b/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj
index 54ec8b638d7..84cd6445588 100644
--- a/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj
+++ b/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>net5.0</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
     <UseBlazorWebAssembly>true</UseBlazorWebAssembly>
     <IsTestAssetProject>true</IsTestAssetProject>
diff --git a/src/Components/test/testassets/TestContentPackage/TestContentPackage.csproj b/src/Components/test/testassets/TestContentPackage/TestContentPackage.csproj
index f0cd18aca91..8d056bb2a86 100644
--- a/src/Components/test/testassets/TestContentPackage/TestContentPackage.csproj
+++ b/src/Components/test/testassets/TestContentPackage/TestContentPackage.csproj
@@ -1,9 +1,8 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>netstandard2.0</TargetFramework>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <OutputType>library</OutputType>
-    <RazorLangVersion>3.0</RazorLangVersion>
     <StaticWebAssetBasePath>_content/TestContentPackage</StaticWebAssetBasePath>
   </PropertyGroup>
 
diff --git a/src/JSInterop/Microsoft.JSInterop/ref/Microsoft.JSInterop.csproj b/src/JSInterop/Microsoft.JSInterop/ref/Microsoft.JSInterop.csproj
index dabf98ff458..a8e9ee1772f 100644
--- a/src/JSInterop/Microsoft.JSInterop/ref/Microsoft.JSInterop.csproj
+++ b/src/JSInterop/Microsoft.JSInterop/ref/Microsoft.JSInterop.csproj
@@ -1,16 +1,10 @@
 <!-- This file is automatically generated. -->
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
     <Nullable>annotations</Nullable>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
-    <Compile Include="Microsoft.JSInterop.netstandard2.0.cs" />
-    <Reference Include="System.Text.Json" />
-    <InternalsVisibleTo Include="Microsoft.JSInterop.Tests" Key="" />
-  </ItemGroup>
-<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
+  <ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
     <Compile Include="Microsoft.JSInterop.netcoreapp.cs" />
     <InternalsVisibleTo Include="Microsoft.JSInterop.Tests" Key="" />
   </ItemGroup>
diff --git a/src/JSInterop/Microsoft.JSInterop/src/Microsoft.JSInterop.csproj b/src/JSInterop/Microsoft.JSInterop/src/Microsoft.JSInterop.csproj
index b49d2ea5910..ebdf3cd3190 100644
--- a/src/JSInterop/Microsoft.JSInterop/src/Microsoft.JSInterop.csproj
+++ b/src/JSInterop/Microsoft.JSInterop/src/Microsoft.JSInterop.csproj
@@ -1,8 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
-    <TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Description>Abstractions and features for interop between .NET and JavaScript code.</Description>
     <PackageTags>javascript;interop</PackageTags>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
diff --git a/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj b/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj
index 41e378682eb..fd443615fea 100644
--- a/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj
+++ b/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
+    <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
     <Nullable>enable</Nullable>
   </PropertyGroup>
 
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in b/src/ProjectTemplates/Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in
index cf1a9eb26b8..78d4ceaeae6 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in
+++ b/src/ProjectTemplates/Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in
@@ -1,9 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Razor">
 
   <PropertyGroup>
-    <TargetFramework Condition="'$(SupportPagesAndViews)' == 'True'">${DefaultNetCoreTargetFramework}</TargetFramework>
-    <TargetFramework Condition="'$(SupportPagesAndViews)' != 'True'">netstandard2.0</TargetFramework>
-    <RazorLangVersion Condition="'$(SupportPagesAndViews)' != 'True'">3.0</RazorLangVersion>
+    <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
     <AddRazorSupportForMvc Condition="'$(SupportPagesAndViews)' == 'True'">true</AddRazorSupportForMvc>
     <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.RazorClassLibrary1</RootNamespace>
   </PropertyGroup>
@@ -13,7 +11,6 @@
   </ItemGroup>
 
   <ItemGroup Condition="'$(SupportPagesAndViews)' != 'True'">
-    <PackageReference Include="Microsoft.AspNetCore.Components" Version="${MicrosoftAspNetCoreComponentsPackageVersion}" />
     <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="${MicrosoftAspNetCoreComponentsWebPackageVersion}" />
   </ItemGroup>
 
-- 
GitLab