Last post Jan 08, 2016 05:57 AM by Chris Zhao
Jan 07, 2016 06:13 PMfirstname.lastname@example.org|LINK
I have created a simple Web API in Visual Studio 2015 and installed and configured it to use Microsoft.Owin security. When running the app from VS using the default IIS Express, everything works fine, but when I switch to use Local IIS, the Startup class
is ignored. I have seen that many people have posted the same issue with many people providing solutions. I have tried all solutions, but none have worked. The target framework is 4.5.2. The local IIS web app is configured to use an AppPool with Integrated
Pipeline configuration. My OS is Windows 10 and I am using IIS version 10.0.10586.
Please help! thanks
Jan 08, 2016 05:57 AM|Chris Zhao|LINK
From OWIN Startup Class Detection
Every OWIN Application has a startup class where you specify components for the application pipeline. There are different ways you can connect your startup class with the runtime, depending on the hosting model you choose (OwinHost, IIS, and IIS-Express).
The startup class shown in this tutorial can be used in every hosting application.
You could connect the startup class with the hosting runtime using one of the these approaches:
1.Naming Convention: Katana looks for a class named Startup in namespace matching the assembly name or the global namespace.
2.OwinStartup Attribute: The following attribute will set the startup class to the TestStartup class in the StartupDemo namespace.
3.The appSetting element in the Configuration file: The appSetting element overrides the OwinStartup attribute and naming convention. You can have multiple startup classes (each using an OwinStartup attribute) and configure which startup class will be loaded
in a configuration file using markup similar to the following:
<add key="owin:appStartup" value="StartupDemo.ProductionStartup" />