Skip to content

Commit b443c7c

Browse files
committed
Upgrade XeroSignInSample to dotnet core 3.1
1 parent 3ef56f3 commit b443c7c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

XeroSignInSample/XeroSignInSample/Startup.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Mvc;
66
using Microsoft.Extensions.Configuration;
77
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.Hosting;
89

910
namespace XeroSignInSample
1011
{
@@ -53,11 +54,11 @@ public void ConfigureServices(IServiceCollection services)
5354
options.CallbackPath = "/signin-oidc";
5455
});
5556

56-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
57+
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
5758
}
5859

5960
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
60-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
61+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
6162
{
6263
if (env.IsDevelopment())
6364
{
@@ -69,15 +70,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
6970
}
7071

7172
app.UseStaticFiles();
73+
app.UseRouting();
7274
app.UseCookiePolicy();
73-
7475
app.UseAuthentication();
76+
app.UseAuthorization();
7577

76-
app.UseMvc(routes =>
78+
app.UseEndpoints(endpoints =>
7779
{
78-
routes.MapRoute(
79-
name: "default",
80-
template: "{controller=Home}/{action=Index}/{id?}");
80+
endpoints.MapControllers();
81+
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
8182
});
8283
}
8384
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
66
</PropertyGroup>
77

88

99
<ItemGroup>
1010
<PackageReference Include="Microsoft.AspNetCore.App" />
11-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
11+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.3" />
1212
</ItemGroup>
1313

1414
</Project>

0 commit comments

Comments
 (0)