diff --git a/samples/HelloWeb/project.json b/samples/HelloWeb/project.json index 48648615396a..25debbf27083 100644 --- a/samples/HelloWeb/project.json +++ b/samples/HelloWeb/project.json @@ -1,11 +1,11 @@ { "version": "0.1-alpha-*", "dependencies": { - "Microsoft.AspNet.Abstractions": "0.1-alpha-*", - "Microsoft.AspNet.Hosting": "0.1-alpha-*", - "Microsoft.AspNet.Server.WebListener": "0.1-alpha-*", - "Microsoft.AspNet.Diagnostics":"0.1-alpha-*", - "Microsoft.AspNet.StaticFiles":"0.1-alpha-*" + "Microsoft.AspNet.Abstractions": "0.1-alpha-279", + "Microsoft.AspNet.Hosting": "0.1-alpha-300", + "Microsoft.AspNet.Server.WebListener": "0.1-alpha-245", + "Microsoft.AspNet.Diagnostics": "0.1-alpha-192", + "Microsoft.AspNet.StaticFiles": "0.1-alpha-223" }, "commands": { "web": "Microsoft.AspNet.Hosting server.name=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001" }, "configurations": { diff --git a/samples/HelloWebFx/Startup.cs b/samples/HelloWebFx/Startup.cs index 9e8a9bd19c41..eda27a4e9bdd 100644 --- a/samples/HelloWebFx/Startup.cs +++ b/samples/HelloWebFx/Startup.cs @@ -1,11 +1,8 @@ +using Microsoft.AspNet; using Microsoft.AspNet.Abstractions; -using Microsoft.AspNet.DependencyInjection; -using Microsoft.AspNet.DependencyInjection.Fallback; using Microsoft.AspNet.Mvc; -using Microsoft.AspNet.RequestContainer; using Microsoft.AspNet.Routing; using Microsoft.AspNet.Diagnostics; -using Microsoft.AspNet; namespace KWebStartup { @@ -13,20 +10,18 @@ public class Startup { public void Configuration(IBuilder app) { - var services = new ServiceCollection(); - services.Add(MvcServices.GetDefaultServices()); - var serviceProvider = services.BuildServiceProvider(app.ServiceProvider); + app.UseErrorPage(); - var routes = new RouteCollection + app.UseServices(services => { - DefaultHandler = new MvcApplication(serviceProvider) - }; + services.AddMvc(); + }); + + app.UseMvc(routes => + { + routes.MapRoute("{controller}/{action}", new { controller = "Home", action = "Index" }); + }); - routes.MapRoute("{controller}/{action}", new { controller = "Home", action = "Index" }); - - app.UseErrorPage(); - app.UseContainer(serviceProvider); - app.UseRouter(routes); app.UseWelcomePage(); } } diff --git a/samples/HelloWebFx/Views/Home/Index.cshtml b/samples/HelloWebFx/Views/Home/Index.cshtml index f86b89eb7fce..b786e64b5e81 100644 --- a/samples/HelloWebFx/Views/Home/Index.cshtml +++ b/samples/HelloWebFx/Views/Home/Index.cshtml @@ -3,7 +3,7 @@ @{ Layout = "/Views/Shared/_Layout.cshtml"; ViewBag.Title = "Home Page"; - string nullValue = null; + string helloClass = null; }