在实时服务器登录失败 - asp.net

时间:2009-06-03 01:36:29

标签: asp.net forms-authentication

我是asp.net的新手,正在尝试在生产服务器上测试我的第一个网站。

我拥有的登录控件“login.aspx”在成功登录后将用户重定向到该站点的管理区域。 当我在Windows XP机器上使用VS2008测试网站时,一切正常,我可以登录并管理网站。我正在使用Forms身份验证来处理登录。

当我将网站上传到生产服务器时,情况就不同了。我可以访问login.aspx页面。当我输入登录详细信息并单击“登录”时,处理页面需要很长时间,甚至页面也会失败。

这是我得到的错误:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) 
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. 

SQLExpress database file auto-creation error: 


The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:


If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist. 
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database. 
Sql Server Express must be installed on the machine. 
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.

任何人都可以帮我解决这个问题。

1 个答案:

答案 0 :(得分:3)

您是否真的读取错误消息?它确切地说出了什么是错的,以及如何解决它:-)

它明确指出“连接字符串使用应用程序App_Data目录中的数据库位置指定本地Sql Server Express实例。提供程序尝试自动创建应用程序服务数据库,因为提供程序确定数据库不存在。”< / p>

Ergo,web.config文件中引用的数据库未上传到生产站点。

将其上传到App_Data,然后返回给我们。

-Oisin

P.S。连接字符串在Web.config中。