Reference Address: Http://www.asp.net/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana
1 Creating an empty ASP.
2 Installing the ADD NuGet Packages management tool
3 Open NuGet console name management program, install Microsoft.owin 2.1.0
Because VS2010 is used, the version is the 4.0 framework, so install 2.1.0, currently the latest is 3.0
Execute command: Install-package microsoft.owin.host.systemweb-version 2.1.0
4 Add a startup class. Add an empty class, name Startup1, and then add the following code.
Using system;using system.threading.tasks;using microsoft.owin;using Owin; [Assembly:owinstartup (typeof (Owinapp.startup1))]namespace owinapp{public class Startup1 {public void Configuration (Iappbuilder app) { app. Run (context = { context. Response.ContentType = "Text/plain"; Return to context. Response.writeasync ("Hello, World"); });
After adding the solution is as follows:
5 Press F5 to run, the following error occurred:
This operation requires the use of IIS integrated pipeline mode.
Description:An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.
Exception Details:System.platformnotsupportedexception: This operation requires the use of IIS integrated pipeline mode.
Source Error:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
Stack trace:
[platformnotsupportedexception: This operation requires the use of IIS integrated pipeline mode. ] System.Web.HttpResponse.get_Headers () +9740986 System.Web.HttpResponseWrapper.get_Headers () +9 Microsoft.Owin.Hos T.systemweb.callheaders.aspnetresponseheaders. ctor (httpresponsebase response) +72 Microsoft.Owin.Host.SystemWeb.OwinCallContext.CreateEnvironment () +434 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.GetInitialEnvironment ( HttpApplication application) +303 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.PrepareInitialContext ( HttpApplication application) +65 Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent (Object sender, EventArgs E, AsyncCallback cb, Object Extradata) +622 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (+285) System.Web.HttpApplication.ExecuteStep (IExecutionStep step, boolean& completedsynchronously) +155
未完待续。
VS2010 Getting Started with Owin and Katana