标签:
2016年,.net 会有很多大更新 ASP.NET 5
在此之前我都是用着古老的.net做开发的 (WebForm + IIS)
为了接下来应对 .net 的新功能,我特地去学习了一下基本的 MVC Owin 等等.
接下来我会针对主题写一些学习笔记.
MVC & Owin setup step
1.New empty project and add folders and code references for "MVC".
2.Install "Microsoft.Owin.Host.SystemWeb" (This is for host in IIS)
3.Remove Global.asax and App_Start
4.Add a Startup.cs file with below code
using System.Web.Mvc; using System.Web.Routing; using Microsoft.Owin; using Owin; [assembly: OwinStartupAttribute(typeof(test.Startup))] namespace test { public class MVCRouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapMvcAttributeRoutes(); } } public partial class Startup { public void Configuration(IAppBuilder app) { AreaRegistration.RegisterAllAreas(); MVCRouteConfig.RegisterRoutes(RouteTable.Routes); } } }
Visual Studio 2015 Owin+MVC+WebAPI+ODataV4+Identity+Oauth2.0+AngularJS 1.x 学习笔记
标签:
原文地址:http://www.cnblogs.com/keatkeat/p/5147750.html