ASP.NET Web App的localhost上的IIS错误 [英] IIS Error on localhost for ASP.NET Web App

查看:134
本文介绍了ASP.NET Web App的localhost上的IIS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IIS 7,我在IIS中拥有该站点,并且我创建了虚拟目录。然后我将其转换为应用程序。然后我浏览了它,我的登录页面出现了。我去登录了,我收到一个错误:



I am using IIS 7 and I have the site in IIS and I created the virtual directory. Then I converted it to an application. I then browsed it and my login page I made came up. I went to login and I get an error:

Server Error in '/sacsapp' Application.
Login failed for user 'SACS-COC\SPARE-PC$'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'SACS-COC\SPARE-PC$'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.





当我运行程序时VS一切正常。这是为什么?我做错了什么? Web应用程序也连接了一个数据库。有人可以帮忙吗?!!



When I run the program in VS everything works. Why is that? What did I do wrong? There is a database the web app is connected also. Can Someone please help?!!

推荐答案

'。
描述: 未处理 exception 发生 <-span> = 执行 当前 web request review stack trace for 更多 信息 关于 错误 其中 it originated 代码

异常 详情: 系统数据 SqlClient SqlException: 登录 失败 for user 'SACS-COC \ SPARE-PC
'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'SACS-COC\SPARE-PC


'。

来源 错误:

未处理 exception span 生成 执行 当前 web request 信息 关于 origin location 例外 已识别 使用 exception stack 跟踪 下面。
'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.





当我运行程序时VS一切正常。这是为什么?我做错了什么? Web应用程序也连接了一个数据库。有人可以帮忙吗?!!



When I run the program in VS everything works. Why is that? What did I do wrong? There is a database the web app is connected also. Can Someone please help?!!


我尝试将此作为评论提交,但代码没有显示,让我们尝试将其作为解决方案。 :)



当您在visual studio中运行时,您的应用程序将在您登录计算机的帐户下运行。这是将用于访问您的数据库的帐户。对我来说,我通常以管理员身份登录,可以完全访问我的数据库。对你来说也是如此。



现在,当您在IIS中进行设置时,默认情况下(除非您已做其他事情),Web应用程序将在该服务器上的本地帐户下运行。这听起来像你的情况,因为错误消息说:登录失败的用户SACS-COC \ SPARE-PC
I tried submiting this as a comment, but the code did not display, lets try it as a solution. :)

When you run in visual studio, your app runs under the account you are logged onto your computer as. That is the account that will be used to access your database. For me, i am usually logged in as an adminstrator with full access to my databases. The same may be true for you.

Now, when you set things up in IIS, by default (unless you have done something else), the web app will run under a local account on that server. Which sounds like the case for you since the error message says: login failed for user SACS-COC\SPARE-PC


这篇关于ASP.NET Web App的localhost上的IIS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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