我使用基于表单的身份验证开发了一个 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>
展示信息
我可以使用 VS 内置服务器登录,但无法使用 IIS 登录
编辑
嗨,将流程模型标识更改为 NetworkService 后,早期的错误消失了,但我无法登录
每次显示错误的凭据错误消息
我使用 asp.net 会员登录控制来获取用户名和密码
它在VS内置服务器中工作