Skip to content

Commit 7a9935b

Browse files
Update .NET Core sample to 3.1 (reactjs#1020)
* Update .NET Core sample to 3.1 * Update azure-pipelines.yml * Update azure-pipelines.yml * Update global.json
1 parent 070d13c commit 7a9935b

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
- task: DotNetCoreInstaller@0
2020
inputs:
2121
packageType: 'sdk'
22-
version: '3.0.100'
22+
version: '3.1.100'
2323

2424
- task: VSBuild@1
2525
inputs:

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "test" ],
33
"sdk": {
4-
"version": "3.0.100-preview"
4+
"version": "3.1.100"
55
}
66
}

src/React.Sample.Webpack.CoreMvc/React.Sample.Webpack.CoreMvc.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<Folder Include="wwwroot\" />
77
</ItemGroup>
88

9-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
9+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
1010
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
1111
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
1212
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="2.2.0" />

src/React.Sample.Webpack.CoreMvc/Startup.cs

-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
using System;
21
using JavaScriptEngineSwitcher.ChakraCore;
32
using JavaScriptEngineSwitcher.Extensions.MsDependencyInjection;
43
using Microsoft.AspNetCore.Builder;
5-
using Microsoft.AspNetCore.Hosting;
64
using Microsoft.AspNetCore.Http;
75
using Microsoft.Extensions.Configuration;
86
using Microsoft.Extensions.DependencyInjection;
@@ -51,7 +49,6 @@ public void Configure(IApplicationBuilder app)
5149

5250
app.UseStaticFiles();
5351

54-
#if NETCOREAPP3_0
5552
app.UseRouting();
5653

5754
app.UseEndpoints(endpoints =>
@@ -60,14 +57,6 @@ public void Configure(IApplicationBuilder app)
6057
endpoints.MapControllerRoute("comments-root", "comments", new { controller = "Home", action = "Index" });
6158
endpoints.MapControllerRoute("comments", "comments/page-{page}", new { controller = "Home", action = "Comments" });
6259
});
63-
#else
64-
app.UseMvc(routes =>
65-
{
66-
routes.MapRoute("default", "{path?}", new { controller = "Home", action = "Index" });
67-
routes.MapRoute("comments-root", "comments", new { controller = "Home", action = "Index" });
68-
routes.MapRoute("comments", "comments/page-{page}", new { controller = "Home", action = "Comments" });
69-
});
70-
#endif
7160
}
7261
}
7362
}

0 commit comments

Comments
 (0)