The system cannot find the file specified

0

SQL Server 2008 R2 kullanan Asp.Net C# MVC uygulamasını çalıştırmak istediğimde aşağıdaki hatayı alıyorum:

Server Error in '/' Application.

The system cannot find the file specified 
  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: 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: 

[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.)]

 

 

[Win32Exception (0x80004005): The system cannot find the file specified]

Asp.Net uygulaması Visual Studio 2013 ile geliştirildi ve Localdb kullanıyor. Uygulama lokalde sorunsuz çalışıyorken, sunucuya atıldığında yukaırdaki hatayı veriyor.


Asp.Net MVC 4 uygulamasında alınan bu hatanın çözümü nedir?

alattin alattin (16984)
9 yıl önce sordu

    Toplam 1 Cevap


    0

    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.)]

    Bu hata SQL bağlantısı yapılamadığında ortaya çıkar.  SQL sunucuda sorun olması bağlantı cümlesinde hata bulunması gibi sebepler bu hatayı almanızı  neden olur.

    Eğer LocalDB kullanıyorsanız, The system cannot find the file specified  hatası sunucu üzerinde localdb desteği olmadığında alınır.

    Eğer sunucuda MS SQL Server 2008 Express çalışıyorsa ve localdb yüklenmemişse sunucuya localdb'nin yüklenmesi gerekir.

     

    Dosyalarını indirin ve sunucuda kurulumu gerçekleştirin.

     

    Bu dosyalar sunucuya SQL Server 2012 LOCALDB yüklemesini gerçekleştirecektir.

    Yükleme bittikten sonra LocalDB artık kullanılabilir.

    Eğer normal bir SQL Server veritabanı kullanıyorsanız, öncelikle sunucunun çalışır durumda olduğundan emin olun.  Daha sonra SQL bağlantı cümlenizi kontrol edin.  

    Web.config içindeki bağlantu cümleniz içindeki data source alanı hatalıysa The system cannot find the file specified hatası alırsınız.

    Bu hata SQL sunucu bulunamıyor anlamına gelmektedir.

    Örneğin Entity Framework kullanıyorsanız web.config içindeki ConnectionStrings bölümünde yazan bilgilerin doğruluğunu kontrol edin.

     <connectionStrings>
        <add name="VeritabaniEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLExpress;initial catalog=Veritabani;persist security info=True;user id=******;password=*****;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
      </connectionStrings>

    Initial Catalog, Data Source, user id, password gibi alanların sizin bağlanti ifadeniz ile uyuşması gerekmektedir.

    alattin alattin (16984)
    9 yıl önce cevaplandı

    üyelik gerektirir

    Cevap yazabilmek için üye girişi yapmalısınız.

    Eğer uzmanim.net üyesiyseniz giriş yapabilirsiniz: üye girişi yap
    uzmanim.net'e üye olmak çok kolaydır: hemen kayıt ol