在IIS上部署asp.net网站给出问题的原因?

时间:2012-05-28 09:57:07

标签: asp.net deployment iis-7 website-deployment

我使用基于表单的身份验证开发了一个asp.net站点,当我从visual studio内置服务器运行时,该站点工作,但是当我在IIS服务器中部署它时,当我尝试登录时显示以下错误

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. 
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: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

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.  

我使用的是asp.net默认模板,但是我通过web.config文件配置了用户授权,比如

<authentication mode="Forms">
  <forms loginUrl="~/Login.aspx" 
         name=".ASPXAUTH"
         path="/"
         requireSSL="false"
         slidingExpiration="true"
         defaultUrl="~/Admin/OrderHistory.aspx"
         cookieless="UseDeviceProfile"
         enableCrossAppRedirects="false"
         >
    <credentials passwordFormat="Clear">
      <user name="Admin" password="adm123$"/>
      <user name="Administrator" password="adm234%"/>
    </credentials>
  </forms>
</authentication>

Imp info

我可以使用VS内置服务器登录但无法使用IIS登录

修改

您将流程模型标识更改为NetworkService之后,之前的错误已消失,但我无法登录

每次显示错误的凭据错误消息

我使用asp.net会员登录控制来获取用户名和密码

在VS内置服务器中工作

1 个答案:

答案 0 :(得分:1)

尝试从本地PC连接到您的实时数据库,这将清除您是否使用您使用的用户名/密码,或者必须完成某些IIS配置。

您还可以查看此链接http://blogs.iis.net/bills/archive/2009/10/07/error-connecting-to-sql-server-from-windows-7-windows-2008-r2-with-asp-net.aspx