Skip to content

Commit 273fefa

Browse files
committed
Partially move to sdk 2.1
1 parent 68d0e09 commit 273fefa

4 files changed

Lines changed: 19 additions & 18 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ Thumbs.db
4343
/Scripts/restore.log
4444
/restore.log
4545
/.vs/SimpleToDoService/xs/UserPrefs.xml
46+
/.vs

src/SimpleToDoService/Program.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Threading.Tasks;
1+
using Microsoft.AspNetCore;
62
using Microsoft.AspNetCore.Hosting;
3+
using NLog.Web;
74

85
namespace SimpleToDoService
96
{
107
public class Program
118
{
129
public static void Main(string[] args)
1310
{
14-
var host = new WebHostBuilder()
11+
CreateWebHostBuilder(args)
1512
.UseKestrel()
16-
//.UseContentRoot(Directory.GetCurrentDirectory())
17-
.UseStartup<Startup>()
18-
.Build();
19-
20-
host.Run();
13+
.Build()
14+
.Run();
2115
}
16+
17+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
18+
WebHost.CreateDefaultBuilder(args)
19+
.UseStartup<Startup>()
20+
.UseNLog();
2221
}
2322
}
23+

src/SimpleToDoService/SimpleToDoService.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
1+
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<PreserveCompilationContext>true</PreserveCompilationContext>
66
<DebugType>Portable</DebugType>
77
<RootNamespace>SimpleToDoService</RootNamespace>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
12-
<PackageReference Include="NLog.Web.AspNetCore" Version="4.4.1" />
13-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0-preview2-final" />
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.App" />
13+
<PackageReference Include="NLog.Web.AspNetCore" Version="4.5.4" />
14+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/SimpleToDoService/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
9999
loggerFactory.AddNLog();
100100

101101
//add NLog.Web
102-
app.AddNLogWeb();
102+
//app.AddNLogWeb();
103103

104104
//configure nlog.config in your project root.
105105
env.ConfigureNLog("nlog.config");

0 commit comments

Comments
 (0)