diff --git a/samples/AntiforgerySample/Startup.cs b/samples/AntiforgerySample/Startup.cs index 7920eb3c6d..bf846c635f 100644 --- a/samples/AntiforgerySample/Startup.cs +++ b/samples/AntiforgerySample/Startup.cs @@ -5,6 +5,7 @@ using System; using System.IO; using Microsoft.AspNet.Antiforgery; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.AspNet.Routing; using Microsoft.Extensions.DependencyInjection; @@ -69,5 +70,15 @@ namespace AntiforgerySample app.UseRouter(routes.Build()); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/samples/AntiforgerySample/hosting.json b/samples/AntiforgerySample/hosting.json new file mode 100644 index 0000000000..f8ef14574d --- /dev/null +++ b/samples/AntiforgerySample/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} diff --git a/samples/AntiforgerySample/project.json b/samples/AntiforgerySample/project.json index 0bd3d43bb3..d9b8cc547d 100644 --- a/samples/AntiforgerySample/project.json +++ b/samples/AntiforgerySample/project.json @@ -1,38 +1,39 @@ { - "webroot": "wwwroot", - "version": "1.0.0-*", + "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Antiforgery": "1.0.0-*", - "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc2-16062", + "Microsoft.AspNet.Http.Abstractions": "1.0.0-*", "Microsoft.AspNet.Http.Extensions": "1.0.0-*", "Microsoft.AspNet.Routing.Extensions": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Newtonsoft.Json": "7.0.1" }, - "commands": { - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000", - "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000" - }, + "compilationOptions": { + "emitEntryPoint": true + }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - }, + "commands": { + "web": "AntiforgerySample" + }, - "publishExclude": [ - "node_modules", - "bower_components", - "**.xproj", - "**.user", - "**.vspscc" - ], - "exclude": [ - "wwwroot", - "node_modules", - "bower_components" - ] + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + }, + + "publishExclude": [ + "node_modules", + "bower_components", + "**.xproj", + "**.user", + "**.vspscc" + ], + "exclude": [ + "wwwroot", + "node_modules", + "bower_components" + ] } diff --git a/samples/AntiforgerySample/wwwroot/web.config b/samples/AntiforgerySample/wwwroot/web.config new file mode 100644 index 0000000000..9a0d90abf8 --- /dev/null +++ b/samples/AntiforgerySample/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file