Skip to content

Commit a39443e

Browse files
author
Erez Testiler
committed
Upgrade to rc1-final.
1 parent 778e340 commit a39443e

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

AspNetWindowsService.sln

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{58DCF7A9-2DB
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4AEF0F43-655C-4AE2-ADB1-3993A0895B6F}"
99
ProjectSection(SolutionItems) = preProject
10-
global.json = global.json
1110
src\AspNetWindowsService\global.json = src\AspNetWindowsService\global.json
12-
NuGet.Config = NuGet.Config
1311
EndProjectSection
1412
EndProject
1513
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNetWindowsService", "src\AspNetWindowsService\AspNetWindowsService.xproj", "{26950A60-193A-46B6-8430-21E2B59C5214}"

src/AspNetWindowsService/Program.cs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Microsoft.AspNet.Builder;
22
using Microsoft.AspNet.Hosting;
33
using Microsoft.AspNet.Hosting.Internal;
4-
using Microsoft.Framework.Configuration;
5-
using Microsoft.Framework.Configuration.Memory;
6-
using Microsoft.Framework.DependencyInjection;
4+
using Microsoft.Extensions.Configuration;
5+
using Microsoft.Extensions.Configuration.Memory;
6+
using Microsoft.Extensions.DependencyInjection;
77
using System;
88
using System.Diagnostics;
99
using System.Linq;
@@ -13,14 +13,7 @@ namespace MyDnxService
1313
{
1414
public class Program : ServiceBase
1515
{
16-
private readonly IServiceProvider _serviceProvider;
17-
private IHostingEngine _hostingEngine;
18-
private IDisposable _shutdownServerDisposable;
19-
20-
public Program(IServiceProvider serviceProvider)
21-
{
22-
_serviceProvider = serviceProvider;
23-
}
16+
private IApplication _application;
2417

2518
public void Main(string[] args)
2619
{
@@ -48,13 +41,14 @@ protected override void OnStart(string[] args)
4841
{
4942
try
5043
{
51-
Microsoft.Dnx.Runtime.Infrastructure.CallContextServiceLocator.Locator.ServiceProvider = _serviceProvider;
52-
5344
var configProvider = new MemoryConfigurationProvider();
5445
configProvider.Add("server.urls", "http://localhost:5000");
5546

56-
var config = new ConfigurationBuilder(configProvider).Build();
57-
var builder = new WebHostBuilder(_serviceProvider, config);
47+
var config = new ConfigurationBuilder()
48+
.Add(configProvider)
49+
.Build();
50+
51+
var builder = new WebHostBuilder(config);
5852
builder.UseServer("Microsoft.AspNet.Server.Kestrel");
5953
builder.UseServices(services => services.AddMvc());
6054
builder.UseStartup(appBuilder =>
@@ -64,8 +58,8 @@ protected override void OnStart(string[] args)
6458
appBuilder.UseMvc();
6559
});
6660

67-
_hostingEngine = builder.Build();
68-
_shutdownServerDisposable = _hostingEngine.Start();
61+
var hostingEngine = builder.Build();
62+
_application = hostingEngine.Start();
6963
}
7064
catch (Exception ex)
7165
{
@@ -76,8 +70,7 @@ protected override void OnStart(string[] args)
7670

7771
protected override void OnStop()
7872
{
79-
if (_shutdownServerDisposable != null)
80-
_shutdownServerDisposable.Dispose();
73+
_application?.Dispose();
8174
}
8275
}
8376
}

src/AspNetWindowsService/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"run": {
44
"commandName": "run",
5-
"sdkVersion": "dnx-clr-win-x86.1.0.0-beta8"
5+
"sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-final"
66
}
77
}
88
}

src/AspNetWindowsService/global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "1.0.0-rc1-final"
4+
}
5+
}

src/AspNetWindowsService/project.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
}
1313
},
1414
"dependencies": {
15-
"Microsoft.AspNet.Hosting": "1.0.0-beta8",
16-
"Microsoft.AspNet.Server.Kestrel": "1.0.0-beta8",
17-
"Microsoft.AspNet.StaticFiles": "1.0.0-beta8",
18-
"Microsoft.AspNet.Mvc": "6.0.0-beta8"
15+
"Microsoft.AspNet.Hosting": "1.0.0-rc1-final",
16+
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
17+
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
18+
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final"
1919
}
2020
}

0 commit comments

Comments
 (0)