Skip to content

Commit aba66e7

Browse files
committed
[Blazor] Pins the SDK version to the latest released SDK and forces projects to compile against the latest released framework
1 parent 548ae26 commit aba66e7

File tree

12 files changed

+50
-25
lines changed

12 files changed

+50
-25
lines changed

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<add key="darc-pub-aspnet-Extensions-4ebd75b" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-aspnet-Extensions-4ebd75b9/nuget/v3/index.json" />
1414
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
1515
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
16+
<add key="aspnet-stable" value="https://dotnetfeed.blob.core.windows.net/dotnet-core-3-1-rtm-014727/index.json" />
1617
<add key="grpc-nuget-dev" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
1718
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
1819
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
<!-- Packages from dotnet/roslyn -->
6767
<MicrosoftNetCompilersToolsetPackageVersion>3.4.0-beta4-19569-03</MicrosoftNetCompilersToolsetPackageVersion>
6868
<!-- Packages from dotnet/core-setup -->
69-
<MicrosoftExtensionsDependencyModelPackageVersion>3.1.1-servicing.19572.8</MicrosoftExtensionsDependencyModelPackageVersion>
70-
<MicrosoftNETCoreAppRefPackageVersion>3.1.1-servicing.19572.8</MicrosoftNETCoreAppRefPackageVersion>
71-
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.1.1-servicing.19572.8</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
69+
<MicrosoftExtensionsDependencyModelPackageVersion>3.1.0</MicrosoftExtensionsDependencyModelPackageVersion>
70+
<MicrosoftNETCoreAppRefPackageVersion>3.1.0</MicrosoftNETCoreAppRefPackageVersion>
71+
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.1.0</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
7272
<NETStandardLibraryRefPackageVersion>2.1.0</NETStandardLibraryRefPackageVersion>
7373
<!-- Packages from dotnet/corefx -->
7474
<MicrosoftBclAsyncInterfacesPackageVersion>1.1.0</MicrosoftBclAsyncInterfacesPackageVersion>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "3.1.100-preview1-014400"
3+
"version": "3.1.100"
44
},
55
"tools": {
6-
"dotnet": "3.1.100-preview1-014400",
6+
"dotnet": "3.1.100",
77
"runtimes": {
88
"dotnet/x64": [
99
"$(MicrosoftNETCoreAppRuntimeVersion)"

src/Components/Blazor/DevServer/src/Microsoft.AspNetCore.Blazor.DevServer.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
<Description>Development server for use when building Blazor applications.</Description>
1212
<!-- Set this to false because assemblies should not reference this assembly directly, (except for tests, of course). -->
1313
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
14+
15+
<!-- This is so that we add the FrameworkReference to Microsoft.AspNetCore.App -->
16+
<UseLatestAspNetCoreReference>true</UseLatestAspNetCoreReference>
1417
</PropertyGroup>
1518

1619
<ItemGroup>
1720
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
18-
<Reference Include="Microsoft.AspNetCore.Components.Server" />
19-
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
20-
<Reference Include="Microsoft.AspNetCore" />
2121
<Reference Include="Microsoft.Extensions.CommandLineUtils.Sources" />
22-
<Reference Include="Microsoft.Extensions.Hosting" />
2322
</ItemGroup>
2423

2524
<!-- Pack settings -->

src/Components/Blazor/Directory.Build.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
<VersionPrefix>3.1.0</VersionPrefix>
77
<PreReleaseVersionLabel>preview4</PreReleaseVersionLabel>
88
<DotNetFinalVersionKind />
9+
<!-- This property points to the latest released Microsoft.AspNetCore.App version it needs to be updated to
10+
target the latest patch before a preview release. -->
11+
<LatestAspNetCoreReferenceVersion>3.1.0</LatestAspNetCoreReferenceVersion>
912
</PropertyGroup>
10-
</Project>
13+
</Project>

src/Components/Blazor/Directory.Build.targets

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,25 @@
44
<PropertyGroup>
55
<ComponentsPackageVersion>$(PackageVersion)</ComponentsPackageVersion>
66
</PropertyGroup>
7+
8+
<!-- We need to do this because our build config interferes with the FrameworkReference definition.
9+
This is a way to add the framework defition to the projects that need it (like Blazor Server and
10+
Blazor Dev Server) -->
11+
<Target Name="_AddAspNetCoreFrameworkReference" BeforeTargets="ProcessFrameworkReferences" Condition="'$(UseLatestAspNetCoreReference)' == 'true' ">
12+
<ItemGroup>
13+
<FrameworkReference Include="Microsoft.AspNetCore.App" Version="$(LatestAspNetCoreReferenceVersion)" />
14+
<KnownFrameworkReference Include="Microsoft.AspNetCore.App">
15+
<TargetFramework>netcoreapp3.1</TargetFramework>
16+
<RuntimeFrameworkName>Microsoft.AspNetCore.App</RuntimeFrameworkName>
17+
<DefaultRuntimeFrameworkVersion>$(LatestAspNetCoreReferenceVersion)</DefaultRuntimeFrameworkVersion>
18+
<LatestRuntimeFrameworkVersion>$(LatestAspNetCoreReferenceVersion)</LatestRuntimeFrameworkVersion>
19+
<TargetingPackName>Microsoft.AspNetCore.App.Ref</TargetingPackName>
20+
<TargetingPackVersion>$(LatestAspNetCoreReferenceVersion)</TargetingPackVersion>
21+
<RuntimePackNamePatterns>Microsoft.AspNetCore.App.Runtime.**RID**</RuntimePackNamePatterns>
22+
<RuntimePackRuntimeIdentifiers>linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86</RuntimePackRuntimeIdentifiers>
23+
<IsTrimmable>true</IsTrimmable>
24+
</KnownFrameworkReference>
25+
</ItemGroup>
26+
27+
</Target>
728
</Project>

src/Components/Blazor/Server/src/Microsoft.AspNetCore.Blazor.Server.csproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
55
<Description>Runtime server features for ASP.NET Core Blazor applications.</Description>
66
<IsShippingPackage>true</IsShippingPackage>
7+
8+
<!-- This is so that we add the FrameworkReference to Microsoft.AspNetCore.App -->
9+
<UseLatestAspNetCoreReference>true</UseLatestAspNetCoreReference>
710
</PropertyGroup>
811

912
<ItemGroup>
1013
<Compile Include="$(ComponentsSharedSourceRoot)\src\CacheHeaderSettings.cs" Link="Shared\CacheHeaderSettings.cs" />
1114
</ItemGroup>
1215

1316
<ItemGroup>
14-
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />
15-
<Reference Include="Microsoft.AspNetCore.SpaServices.Extensions" />
16-
<Reference Include="Microsoft.AspNetCore.StaticFiles" />
17-
<Reference Include="Microsoft.AspNetCore.WebSockets" />
18-
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
1917
<Reference Include="Newtonsoft.Json" />
2018

2119
<!-- Used by ws-proxy sources only. Remove this once we're able to consume ws-proxy as a NuGet package. -->

src/Components/Blazor/testassets/HostedInAspNet.Server/HostedInAspNet.Server.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
5+
<!-- This is so that we add the FrameworkReference to Microsoft.AspNetCore.App -->
6+
<UseLatestAspNetCoreReference>true</UseLatestAspNetCoreReference>
7+
58
</PropertyGroup>
69

710
<ItemGroup>
@@ -10,8 +13,6 @@
1013

1114
<ItemGroup>
1215
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
13-
<Reference Include="Microsoft.AspNetCore" />
14-
<Reference Include="Microsoft.Extensions.Hosting" />
1516
</ItemGroup>
1617

1718
</Project>

src/Components/Blazor/testassets/MonoSanity/MonoSanity.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<PropertyGroup>
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
5+
<!-- This is so that we add the FrameworkReference to Microsoft.AspNetCore.App -->
6+
<UseLatestAspNetCoreReference>true</UseLatestAspNetCoreReference>
57
</PropertyGroup>
68

79
<ItemGroup>
810
<ProjectReference Include="..\MonoSanityClient\MonoSanityClient.csproj" />
911
</ItemGroup>
1012

1113
<ItemGroup>
12-
<Reference Include="Microsoft.AspNetCore" />
1314
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
14-
<Reference Include="Microsoft.Extensions.Hosting" />
1515
</ItemGroup>
1616

1717
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Project>
2+
<Import Project="..\..\Blazor\Directory.Build.props" />
3+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Project>
2+
<Import Project="..\..\Blazor\Directory.Build.targets" />
3+
</Project>

src/Components/test/testassets/TestServer/Components.TestServer.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
<PropertyGroup>
44
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
5+
<!-- This is so that we add the FrameworkReference to Microsoft.AspNetCore.App -->
6+
<UseLatestAspNetCoreReference>true</UseLatestAspNetCoreReference>
57
</PropertyGroup>
68

79
<ItemGroup>
8-
<Reference Include="Microsoft.AspNetCore" />
9-
<Reference Include="Microsoft.AspNetCore.Authentication.Cookies" />
1010
<Reference Include="Microsoft.AspNetCore.Blazor.Server" />
11-
<Reference Include="Microsoft.AspNetCore.Components.Server" />
12-
<Reference Include="Microsoft.AspNetCore.Cors" />
13-
<Reference Include="Microsoft.AspNetCore.Mvc" />
1411
<Reference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" />
1512
<Reference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" />
16-
<Reference Include="Microsoft.Extensions.Hosting" />
1713
<Reference Include="Microsoft.Extensions.Logging.Testing" />
1814
</ItemGroup>
1915

0 commit comments

Comments
 (0)