Skip to content

Commit 8e07c83

Browse files
committed
Upgrade to netcore 3.1
1 parent 705a0c6 commit 8e07c83

10 files changed

Lines changed: 114 additions & 36 deletions

File tree

.vscode/launch.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (web)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/UnitTestingDemo/UnitTestingDemo/bin/Debug/netcoreapp2.2/UnitTestingDemo.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/UnitTestingDemo/UnitTestingDemo",
16+
"stopAtEntry": false,
17+
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18+
"serverReadyAction": {
19+
"action": "openExternally",
20+
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
21+
},
22+
"env": {
23+
"ASPNETCORE_ENVIRONMENT": "Development"
24+
},
25+
"sourceFileMap": {
26+
"/Views": "${workspaceFolder}/Views"
27+
}
28+
},
29+
{
30+
"name": ".NET Core Attach",
31+
"type": "coreclr",
32+
"request": "attach",
33+
"processId": "${command:pickProcess}"
34+
}
35+
]
36+
}

.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/UnitTestingDemo/UnitTestingDemo/UnitTestingDemo.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/UnitTestingDemo/UnitTestingDemo/UnitTestingDemo.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/UnitTestingDemo/UnitTestingDemo/UnitTestingDemo.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
}
41+
]
42+
}

UnitTestingDemo/UnitTestingDemo.Data.Tests/UnitTestingDemo.Data.Tests.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="EntityFrameworkCoreMock.Moq" Version="1.0.0.20" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.0" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
13-
<PackageReference Include="Moq" Version="4.10.1" />
14-
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
15-
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
10+
<PackageReference Include="EntityFrameworkCoreMock.Moq" Version="1.0.0.30" />
11+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.3" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.3" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
14+
<PackageReference Include="Moq" Version="4.13.1" />
15+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
16+
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
1617
</ItemGroup>
1718

1819
<ItemGroup>

UnitTestingDemo/UnitTestingDemo.Data/UnitTestingDemo.Data.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.2" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.2" />
8+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.3" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.3">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
</PackageReference>
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.3" />
1014
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
11-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.2">
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.3">
1216
<PrivateAssets>all</PrivateAssets>
1317
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1418
</PackageReference>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

UnitTestingDemo/UnitTestingDemo.Services.Tests/UnitTestingDemo.Services.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
11-
<PackageReference Include="Moq" Version="4.10.1" />
12-
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
13-
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
11+
<PackageReference Include="Moq" Version="4.13.1" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
13+
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

UnitTestingDemo/UnitTestingDemo.Services/UnitTestingDemo.Services.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.App" Version=""/>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
12-
<PackageReference Include="Moq" Version="4.10.1" />
13-
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
14-
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
11+
<PackageReference Include="Moq" Version="4.13.1" />
12+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
13+
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
1514
</ItemGroup>
1615

1716
<ItemGroup>
1817
<ProjectReference Include="..\UnitTestingDemo.Services\UnitTestingDemo.Services.csproj" />
1918
<ProjectReference Include="..\UnitTestingDemo\UnitTestingDemo.csproj" />
2019
</ItemGroup>
21-
2220
</Project>

UnitTestingDemo/UnitTestingDemo/Startup.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.EntityFrameworkCore;
77
using Microsoft.Extensions.Configuration;
88
using Microsoft.Extensions.DependencyInjection;
9+
using Microsoft.Extensions.Hosting;
910
using UnitTestingDemo.Data;
1011
using UnitTestingDemo.Data.Adapters;
1112
using UnitTestingDemo.Data.Contexts;
@@ -43,11 +44,11 @@ public void ConfigureServices(IServiceCollection services)
4344
services.AddTransient<IBookRepository, BookRepository>();
4445
services.AddTransient<IBookService, BookService>();
4546

46-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
47+
services.AddMvc();
4748
}
4849

4950
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
50-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
51+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5152
{
5253
if (env.IsDevelopment())
5354
{
@@ -64,11 +65,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
6465
app.UseStaticFiles();
6566
app.UseCookiePolicy();
6667

67-
app.UseMvc(routes =>
68+
app.UseEndpoints(endpoints =>
6869
{
69-
routes.MapRoute(
70-
name: "default",
71-
template: "{controller=Home}/{action=Index}/{id?}");
70+
endpoints.MapDefaultControllerRoute();
7271
});
7372
}
7473
}

UnitTestingDemo/UnitTestingDemo/UnitTestingDemo.csproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +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>
10-
<PackageReference Include="Microsoft.AspNetCore.App" />
11-
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
12-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
13-
<PackageReference Include="morelinq" Version="3.1.0" />
10+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.2" />
11+
<PackageReference Include="morelinq" Version="3.3.2" />
1412
</ItemGroup>
1513

1614

0 commit comments

Comments
 (0)