Я развернул приложение ASP.NET MVC 5 на сервере, но он сбой на каждой странице с помощью localdb.Проблема при развертывании приложения ASP.NET MVC + LocalDB
Однако я скопировал папку App_Data
, где находится файл .mdf
. И я даже установил SQL Server 2012 Express на машине.
Тем не менее каждый раз, когда я получаю ту же ошибку.
Le fichier spécifié est introuvable
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ComponentModel.Win32Exception: Le fichier spécifié est introuvable
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): Le fichier spécifié est introuvable]
[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) +5352431
Извините, часть его на французском языке, несмотря на то, что я установил ui для нас - английский.
web.config
файл выглядит следующим образом:
<connectionStrings>
<add name="ConnectionString"
connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=C:\inetpub\wwwroot\MygLogWeb\App_Data\Database.mdf;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
И это было, как это раньше:
<add name="ConnectionString"
connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True"
providerName="System.Data.SqlClient"/>
Тогда для чего нужен LocalDB? – Serge
Быстрое развитие. Тестирование. Подобно тому, как Visual Studio может создавать новый веб-сервер по требованию, а не заставлять вас сначала настроить IIS, чтобы увидеть, как работает приложение. –
Что делать, если вы используете производственную базу данных? –