IIS 8.5中的OWIN和ASP.net成员身份不起作用 [英] OWIN and ASP.net membership in IIS 8.5 not working

查看:98
本文介绍了IIS 8.5中的OWIN和ASP.net成员身份不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2015中创建了一个ASP.NET MVC项目.我将基于Windows Identity Foundation的模板用于Visual Studio中可用的个人帐户.

I created an ASP.NET MVC project in visual studio 2015. I used the Windows Identity Foundation based template for individual accounts available in visual studio.

然后我为Facebook和Google配置它.

Then I configure it for facebook and Google.

当我从Visual Studio或IIS 7.5运行它时,它可以完美地工作.我可以重定向到Google或Facebook页面,并且可以使用电子邮件进行注册,并且可以看到数据库中保存的记录.

It works perfectly when i run it from Visual Studio or IIS 7.5. I Could redirect to Google or Facebook page and I was able to register using email and I could see the records saved in the database.

但是,当我在Windows Server 2012 R2上运行的IIS 8.5上部署应用程序时,单击Facebook或google按钮时,出现404资源未找到错误.

However, when i deploy the app on IIS 8.5 running on windows server 2012 R2, on clicking the Facebook or google button, gives me 404 Resource Not Found Error.

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /account/externallogin

我的问题是我是否需要在IIS 8.5上进行任何进一步的配置才能使外部身份验证起作用.我认为问题是IIS 8.5无法识别Startup类.

My question is do I need to do any further configuration on IIS 8.5 to get the External Authentication to work. I think the problem is IIS 8.5 is not able to recognize Startup class.

我添加了nuget包Microsoft.Owin.Host.Systemweb.

I have added nuget package Microsoft.Owin.Host.Systemweb.

我在OWIN Startup类中声明为

I have a declaration on OWIN Startup class as

[assembly: OwinStartup(typeof(StartupDemo.TestStartup))]

我还添加了

<appSettings>  
  <add key="owin:appStartup" value="StartupDemo.ProductionStartup" />
</appSettings>

在web.config中

in web.config

当我单击注册"按钮时,在IIS 7.5中我可以注册和登录,但是在IIS 8.5上,注册屏幕只是刷新而没有任何消息.

Also when i click register button, in IIS 7.5 i could register and login but on IIS 8.5 the registration screen simply refreshes without any message.

我验证了是否可以通过创建一个简单的控制器来连接SQL Server,并且能够在IIS 8.5中使用所有的添加,编辑,删除和查看操作".

I verified if I could connect my SQL Server by creating a simple controller and i was able to get all Add New, Edit, Delete and View Actions working in IIS 8.5.

我认为IIS 8.5中有一些要求才能使OWIN正常运行,任何帮助将不胜感激

I think there is some requirement in IIS 8.5 to get OWIN working, any help will be much appreciated

推荐答案

  • 确保您的应用程序池处于v4.0集成模式.
  • 确保已将Microsoft.Owin.Host.SystemWeb放置在bin中(我已经安装了它)-只需确保将其也放置在bin文件夹中即可.
  • 阅读此文章了解OWIN中间件如何在IIS集成管道中执行

    Read this article to learn How OWIN Middleware Executes in the IIS Integrated Pipeline

    这篇关于IIS 8.5中的OWIN和ASP.net成员身份不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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