简体   繁体   English

一次无法在IIS上登录ASP.NET MVC站点

[英]Can't log into ASP.NET MVC site once on IIS

I finally got my ASP.NET MVC application hosted on my local Windows/IIS server. 我终于将我的ASP.NET MVC应用程序托管在本地Windows / IIS服务器上。 I went to the login page but when I try to log in it says, 我去了登录页面,但是当我尝试登录时说:

Error: An error occurred while processing your request 错误:处理您的请求时发生错误

This is fairly non-descript... 这是相当无法描述的...

My gut feeling is that when I did the web deploy, I didn't deploy the localdb(?) where the users' credentials are stored. 我的直觉是,当我进行Web部署时,没有部署存储用户凭据的localdb(?)。 Before I try to re-deploy the entire app, I'd like to see if anyone can offer some guidance. 在尝试重新部署整个应用程序之前,我想看看是否有人可以提供一些指导。 Am I on the right track? 我在正确的轨道上吗? Are there other possible causes/solutions I should investigate? 我应该调查其他可能的原因/解决方案吗?

I'm using the default registration/login system that is in the project to start with, and it woks just fine in VS. 我使用的是项目中的默认注册/登录系统,它在VS中可以正常运行。 I did a regular web deploy to my IIS server, and the site works just fine until you go to log in. 我对IIS服务器进行了常规的Web部署,并且该站点可以正常运行,直到您登录为止。

Fixed: This issue was caused (as suspected) by the inaccessibility of the LocalDB where all the users' credentials are stored. 修复:此问题是由怀疑存储所有用户凭据的LocalDB引起的。 VS uses this light DB instead of making you install SQL Express or another alternative (much like IIS Express works better for debugging than full IIS). VS使用这种轻型数据库,而不是让您安装SQL Express或其他替代方法(很像IIS Express比完整的IIS更适合调试)。 When I push my application to IIS from VS, the database wasn't connecting. 当我从VS将应用程序推送到IIS时,数据库未连接。 I eventually found this other SO question, and the top answer fixed my issue. 我最终找到了另一个SO问题,而最重要的答案解决了我的问题。

How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7? 如何在Windows 7上使用localDB将ASP.NET MVC 4应用程序部署到本地IIS?

This will solve the issue, but there is a lot of conflict on the web as to whether or not it is ok to use LocalDB in production, so if you have a lot riding on your project you might want to take a look at that. 这可以解决问题,但是在生产环境中是否可以使用LocalDB时在Web上存在很多冲突,因此,如果您在项目中的工作量很大,则可能需要查看一下。 For my purpose, LocalDB is just fine, so this solved the issue. 对我而言,LocalDB很好,因此可以解决此问题。 Thank you to all who responded to my (admittedly) broad question. 感谢所有回答我(公认的)广泛问题的人。 I'm sure this will be a useful thread for others with the same issue. 我确定这对于其他有相同问题的人来说将是一个有用的线索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM