标签:run 属性 名称空间 sync typeof pac style nbsp dem
Katana在程序集内的程序集名称空间下查找一个叫做Startup的类,
[assembly: OwinStartup(typeof(OwinConsoleApp.Startup))]
<add key="owin:appStartup" value="OwinConsoleApp.Startup1" />
定义友好命名的Startup类
<appSettings> <add key="owin:appStartup" value="ProductionConfiguration" /> </appSettings>
[assembly: OwinStartup("ProductionConfiguration", typeof(StartupDemo.ProductionStartup2))] namespace StartupDemo { public class ProductionStartup { public void Configuration(IAppBuilder app) { app.Run(context => { string t = DateTime.Now.Millisecond.ToString(); return context.Response.WriteAsync(t + " Production OWIN App"); }); } } public class ProductionStartup2 { public void Configuration(IAppBuilder app) { app.Run(context => { string t = DateTime.Now.Millisecond.ToString(); return context.Response.WriteAsync(t + " 2nd Production OWIN App"); }); } } }
标签:run 属性 名称空间 sync typeof pac style nbsp dem
原文地址:http://www.cnblogs.com/LittleFeiHu/p/7351944.html