C# 我的网络应用程序没有';发布时找不到我的数据库

C# 我的网络应用程序没有';发布时找不到我的数据库,c#,asp.net-mvc-3,azure,C#,Asp.net Mvc 3,Azure,我用Visual Studio 2012创建了一个简单的web应用程序,使用MVC3并在Azure上发布 当我在本地运行它时,一切正常。但当我发布时,有一个使用我创建的db的表的页面不会加载。 错误消息是巨大的,但开始时如下所示: Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified Source Error: An unhandled exc

我用Visual Studio 2012创建了一个简单的web应用程序,使用MVC3并在Azure上发布

当我在本地运行它时,一切正常。但当我发布时,有一个使用我创建的db的表的页面不会加载。 错误消息是巨大的,但开始时如下所示:

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
继续下去

有三个表,一个是VisualStudio在其Web应用程序示例中创建的默认表。 另外两个是我自己创建的,它们在发布时都不起作用(在本地运行时非常好)

我假设问题出在连接字符串上,如果这里还有其他问题,请询问:

<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
,并相应地更改
连接字符串


有关

的更多信息,但用于帐户(成员资格、角色等)的“DefaultConnection”工作正常。如果这就是问题所在,这个数据库不也应该被破坏吗?是的,它也不应该工作。您确定这是
成员资格
提供商正在使用的
连接字符串吗?是的,ConnectionString=“DefaultConnection”您解决了这个问题吗?我从azure开始,我有完全相同的问题:)