一个默认的IISMVC4项目,其帐户控制器使用表单身份验证,但此身份验证在我的服务器上的IIS7.5上显示此错误。
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.) 我怎么才能解决这个问题,因为我在课堂上找不到任何联系。
发布于 2013-04-04 19:31:31
默认的MVC4项目依赖于IIS Express和LocalDB,生成的LocalDB存储在App_Data文件夹中。
但是,当将项目更改为在完整的IIS下运行时,建议您切换到使用SQL Express。为此,您需要创建一个数据库并设置相关的连接字符串。假设您的应用程序具有相关权限,并且WebSecurity.InitializeDatabaseConnection已将autoCreateTables设置为true,则会自动创建相关的表。
默认的数据库初始化是通过我们可以在Filters/InitializeSimpleMembershipAttribute.cs中找到的InitializeSimpleMembershipAttribute完成的,然后将该属性应用于AccountController。
发布于 2013-04-04 04:45:53
您应该按照异常消息中的建议检查Windows日志。连接字符串位于web应用程序的web.config文件中。
https://stackoverflow.com/questions/15797693
复制相似问题