我正在开发一个ASP.NET MVC网站,我想在Azure网站上托管。在开发过程中,我一直在我的App_Data目录中使用一个MDF文件,连接字符串如下所示:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=MyApp;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MyApp.mdf;MultipleActiveResultSets=true" providerName="System.Data.sqlClient" />
要在Azure上尝试,我希望我可以保留此连接字符串,只是FTP我的MyApp.mdf到Azure上的App_Data文件夹,因为它都设置了我想要使用的示例数据。但是,当我试图访问我的网站,我碰到以下错误:
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 LocalDB
installation. Verify that sql Server Express is properly installed and
that the LocalDB feature is enabled.)
我的问题是,有没有办法我可以运行我的Azure网站连接到MDF文件在我的App_Data文件夹,或者我被迫使用Azure sql数据库?