diff --git a/samples/HelloWorld/Program.cs b/samples/HelloWorld/Program.cs index 7b545803e9..0285c349fa 100644 --- a/samples/HelloWorld/Program.cs +++ b/samples/HelloWorld/Program.cs @@ -9,7 +9,12 @@ namespace HelloWorld { public class Program { - public static async Task Main(string[] args) + public static void Main(string[] args) + { + Run(args).Wait(); + } + + public static async Task Run(string[] args) { using (WebListener listener = new WebListener()) { diff --git a/samples/HelloWorld/project.json b/samples/HelloWorld/project.json index 2d80d1f40d..495007ebed 100644 --- a/samples/HelloWorld/project.json +++ b/samples/HelloWorld/project.json @@ -1,21 +1,19 @@ { + "compilationOptions": { + "emitEntryPoint": true + }, "dependencies": { "Microsoft.Net.Http.Server": "0.1.0-*", - "Microsoft.Net.WebSockets.Server": "0.1.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Net.WebSockets.Server": "0.1.0-*" }, "commands": { "sample": "HelloWorld" }, "frameworks": { - "dnx451": {}, + "net451": {}, "netstandardapp1.5": { "dependencies": { - "System.Collections": "4.0.11-*", - "System.Console": "4.0.0-*", - "System.Globalization": "4.0.11-*", - "System.IO": "4.1.0-*", - "System.Threading.Tasks": "4.0.11-*" + "NETStandard.Library": "1.0.0-*" }, "imports": [ "dnxcore50" diff --git a/samples/HotAddSample/Startup.cs b/samples/HotAddSample/Startup.cs index d2ef0cbfd0..da67990715 100644 --- a/samples/HotAddSample/Startup.cs +++ b/samples/HotAddSample/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Features; using Microsoft.Extensions.Logging; +using Microsoft.Net.Http.Server; namespace HotAddSample { @@ -17,7 +18,7 @@ namespace HotAddSample { loggerfactory.AddConsole(LogLevel.Information); - var addresses = app.ServerFeatures.Get().Addresses; + var addresses = app.ServerFeatures.Get().UrlPrefixes; addresses.Add("http://localhost:12346/pathBase/"); app.Use(async (context, next) => @@ -31,7 +32,7 @@ namespace HotAddSample try { addresses.Add(toAdd); - await context.Response.WriteAsync("Added: " + toAdd); + await context.Response.WriteAsync("Added: " + toAdd + ""); } catch (Exception ex) { @@ -93,6 +94,7 @@ namespace HotAddSample var host = new WebHostBuilder() .UseDefaultConfiguration(args) .UseStartup() + .UseServer("Microsoft.AspNetCore.Server.WebListener") .Build(); host.Run(); diff --git a/samples/HotAddSample/hosting.json b/samples/HotAddSample/hosting.json deleted file mode 100644 index 598af3d3a8..0000000000 --- a/samples/HotAddSample/hosting.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "server": "Microsoft.AspNetCore.Server.WebListener", - "server.urls": "http://localhost:12345" -} diff --git a/samples/HotAddSample/project.json b/samples/HotAddSample/project.json index dde0f7325a..307ed54a6d 100644 --- a/samples/HotAddSample/project.json +++ b/samples/HotAddSample/project.json @@ -2,8 +2,7 @@ "version": "1.0.0-*", "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "compilationOptions": { "emitEntryPoint": true @@ -12,8 +11,11 @@ "web": "HotAddSample" }, "frameworks": { - "dnx451": {}, + "net451": {}, "netstandardapp1.5": { + "dependencies": { + "NETStandard.Library": "1.0.0-*" + }, "imports": [ "dnxcore50" ] diff --git a/samples/SelfHostServer/Startup.cs b/samples/SelfHostServer/Startup.cs index 9ee6194f07..36b3c7f29c 100644 --- a/samples/SelfHostServer/Startup.cs +++ b/samples/SelfHostServer/Startup.cs @@ -43,6 +43,7 @@ namespace SelfHostServer var host = new WebHostBuilder() .UseDefaultConfiguration(args) .UseStartup() + .UseServer("Microsoft.AspNetCore.Server.WebListener") .Build(); host.Run(); diff --git a/samples/SelfHostServer/hosting.json b/samples/SelfHostServer/hosting.json deleted file mode 100644 index c1733ee469..0000000000 --- a/samples/SelfHostServer/hosting.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "server": "Microsoft.AspNetCore.Server.WebListener", - "server.urls": "http://localhost:8080" -} diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index e31b464c7b..d2eccfeff3 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -1,8 +1,7 @@ { "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "compilationOptions": { "emitEntryPoint": true @@ -11,8 +10,11 @@ "web": "SelfHostServer" }, "frameworks": { - "dnx451": {}, + "net451": {}, "netstandardapp1.5": { + "dependencies": { + "NETStandard.Library": "1.0.0-*" + }, "imports": [ "dnxcore50" ]