File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 8
8
using Microsoft . Extensions . DependencyInjection ;
9
9
using Microsoft . Extensions . Logging ;
10
10
using Microsoft . Extensions . Options ;
11
+ using Microsoft . Extensions . Hosting ;
11
12
12
13
namespace surveyjs_aspnet_mvc
13
14
{
@@ -28,26 +29,30 @@ public void ConfigureServices(IServiceCollection services)
28
29
// Adds a default in-memory implementation of IDistributedCache.
29
30
services . AddDistributedMemoryCache ( ) ;
30
31
31
- services . AddSession ( options =>
32
- {
32
+ services . AddSession ( options => {
33
33
// Set a short timeout for easy testing.
34
34
options . IdleTimeout = TimeSpan . FromSeconds ( 300 ) ;
35
35
options . Cookie . HttpOnly = true ;
36
36
} ) ;
37
+
37
38
}
38
39
39
40
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
40
- public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
41
+ public void Configure ( IApplicationBuilder app , IWebHostEnvironment env )
41
42
{
42
- if ( env . IsDevelopment ( ) )
43
- {
43
+ if ( env . IsDevelopment ( ) ) {
44
44
app . UseDeveloperExceptionPage ( ) ;
45
45
}
46
46
47
47
app . UseSession ( ) ;
48
- app . UseMvc ( ) ;
48
+ app . UseRouting ( ) ;
49
49
app . UseDefaultFiles ( ) ;
50
50
app . UseStaticFiles ( ) ;
51
+
52
+ app . UseEndpoints ( endpoints => {
53
+ endpoints . MapControllers ( ) ;
54
+ } ) ;
55
+
51
56
}
52
57
}
53
58
}
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Web" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >netcoreapp2 .1</TargetFramework >
4
+ <TargetFramework >netcoreapp3 .1</TargetFramework >
5
5
</PropertyGroup >
6
6
7
7
<ItemGroup >
8
8
<Folder Include =" wwwroot\" />
9
9
</ItemGroup >
10
10
11
11
<ItemGroup >
12
- <PackageReference Include =" Microsoft.AspNetCore.All" Version =" 2.1.5" />
13
- </ItemGroup >
14
-
15
- <ItemGroup >
16
- <DotNetCliToolReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version =" 2.0.0" />
17
- </ItemGroup >
12
+ <PackageReference Include =" Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version =" 3.1.7" />
13
+ </ItemGroup >
18
14
19
15
</Project >
You can’t perform that action at this time.
0 commit comments