OwinStartup没有发射 [英] OwinStartup not firing

查看:325
本文介绍了OwinStartup没有发射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有OwinStartup配置code完美的工作,然后停止工作。不幸的是我不知道到底是什么我没有得到它停止工作和我有一个很艰难的时间计算出来。

I had the OwinStartup configuration code working perfectly and then it stopped working. Unfortunately I'm not sure exactly what I did to get it to stop working and am having a really hard time figuring it out.

要确保我已经基本覆盖,我翻了一番检查,以确保我有

To make sure I have the basics covered, I doubled checked to make sure the I have the

[assembly:OwinStartup(typeof(WebApplication.Startup))] 

属性正确分配,并确保我没有为owin的appSetting:AutomaticAppStartup被设置为false,所以我做了一个设置为true是安全的,因为什么也没有之前

attribute assigned properly and made sure that I don't have an appSetting for owin:AutomaticAppStartup that is set to false so I made one set to true to be safe as there was nothing there before.

<add key="owin:AutomaticAppStartup" value="true" />

我也试过专门唱出appSetting:

I also tried specifically calling out the appSetting:

<add key="owin:appStartup" value="WebApplication.Startup" />

在它停止工作,我升级了Microsoft.Owin.Security的NuGet包2.0.2,所以我想他们恢复到2.0.1(这是一个痛苦),但它并没有改变任何东西。我已经安装WebActivator的项目和正在使用来引导其他的东西,但我测试过上一个新的WebApplication模板,并在那里工作,所以我不认为这是罪魁祸首。

Before it stopped working I upgraded the Microsoft.Owin.Security NuGet packages to 2.0.2, so I tried reverting them to 2.0.1 (that was a pain) but it didn't change anything. I have WebActivator installed on the project and am using that to bootstrap other things but I've tested that on a fresh WebApplication template and it works there so I don't think that is the culprit.

我也试着删除我的启动类和使用Visual Studio添加使用OWIN启动类请在添加新项新的,而且是没有得到或者叫做。接下来,我尝试添加第二个启动类,因为我知道,如果有一个以上的OwinStartup属性来定义它会抛出异常,但它不抛出任何异常出现。

I also tried removing my Startup class and using Visual Studio to add a new one using the OWIN Startup Class type in Add New Item and that isn't getting called either. Next I tried adding a second Startup class since I know it will throw an exception if there is more than one OwinStartup attributes defined, but it isn't throwing any exception there.

不知道什么尝试。有什么想法?

Not sure what else to try. Any thoughts?

更新

原来,ReSharper的删除了参考Microsoft.Owin.Host.SystemWeb当我用它来删除未使用的引用。

Turns out that Resharper removed the reference to Microsoft.Owin.Host.SystemWeb when I used it to remove unused references.

推荐答案

请确保您在项目中安装Microsoft.Owin.Host.SystemWeb包。需要该软件包启动检测在IIS中托管的应用程序。欲了解更多信息,可以参考<一个href=\"http://www.asp.net/aspnet/overview/owin-and-katana/owin-middleware-in-the-iis-integrated-pipeline\">this文章。

Make sure you have installed Microsoft.Owin.Host.SystemWeb package in the project. This package is needed for startup detection in IIS hosted applications. For more information you can refer to this article.

这篇关于OwinStartup没有发射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆