首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >互联网应用

互联网应用
EN

Stack Overflow用户
提问于 2013-04-04 04:41:53
回答 2查看 58关注 0票数 0

一个默认的IISMVC4项目,其帐户控制器使用表单身份验证,但此身份验证在我的服务器上的IIS7.5上显示此错误。

代码语言:javascript
复制
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.) 

我怎么才能解决这个问题,因为我在课堂上找不到任何联系。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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。

票数 1
EN

Stack Overflow用户

发布于 2013-04-04 04:45:53

您应该按照异常消息中的建议检查Windows日志。连接字符串位于web应用程序的web.config文件中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15797693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档