c# – 我的网络应用程序在发布时找不到我的数据库
发布时间:2020-12-15 05:38:36 所属栏目:百科 来源:网络整理
导读:我使用Visual Studio 2012创建了一个简单的Web应用程序,使用MVC3并在Azure上发布. 当我在本地运行它时,一切正常.但是当我发布时,一个页面中有一个使用我创建的数据库的表不会加载. 错误消息是巨大的,但是从这样开始: Exception Details: System.ComponentMo
我使用Visual Studio 2012创建了一个简单的Web应用程序,使用MVC3并在Azure上发布.
当我在本地运行它时,一切正常.但是当我发布时,一个页面中有一个使用我创建的数据库的表不会加载. Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified 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. Stack Trace: [Win32Exception (0x80004005): The system cannot find the file specified] [SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,Boolean breakConnection,Action`1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,Boolean callerHasConnectionLock,Boolean asyncClose) +558 然后继续. 有三个表,一个是Visual Studio在其Web App示例上创建的Default. 我假设问题出现在连接字符串上,如果我还有更多内容,请询问: <connectionStrings> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)v11.0;Initial Catalog=aspnet-Porta-comprimidos-20130503163319;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnet-Porta-comprimidos-20130503163319.mdf" /> <add name="RemedioDBContext" connectionString="Data Source=|DataDirectory|MeuPortaComprimidosDB.sdf" providerName="System.Data.SqlClient"/> <add name="RemedioTempDBContext" connectionString="" providerName="System.Data.SqlClient"/> 谁能帮帮我吗?我研究了很多,不知道如何处理它(是的,我是新手). 解决方法
您的连接字符串是将数据源设置为LocalDb的设置,默认情况下,Windows Azure计算机上未安装该数据源,您无法使用它(除非您安装它).
您必须将数据库迁移到Windows Azure SQL并相应地更改连接字符串. 有关http://msdn.microsoft.com/en-us/library/windowsazure/ee730904.aspx的更多信息 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Ruby Array to Histogram:如何按范围对数字进行分组?
- xml文件不能被正确解析/The processing instruction target
- dojo famater 自定义转换颜色
- heml Ajax 通过Asp.net访问数据库(以Sql Server为例)
- c – 是否有时间函数,其结果保证每次调用都会改变?
- Jboss standalone-full.xml文件在重新启动时被覆盖
- c# – Entity Framework 3.5或4.0?
- Oracle数据库中ora-12899错误的解决方法
- c# – 具有大或*非常大的文件的Resharper
- C#算法 – 找到所需的最少对象数