title: "The system cannot find the file specified"
body: <p>I saw many questions on SO with this error. But none were related to forms. I just hosted my application server after testing locally. I think it worked for a few mins but I'm not sure as I may have looked at the localhost tab for a moment. Then it stopped working. I may have changed something as I was making changes on server too. </p>
  
  <p>I checked my connection string and also tried logging into the DB using other ways and it is online. So, any clues what could be wrong. I don't think it is possible that sql server is only not responding to requests from an app and is available if you log in through SSMS.</p>
  
  <p>Below is the error I get.</p>
  
  <blockquote>
    <p>Server Error in '/' Application.</p>
    
    <p>The system cannot find the file specified</p>
    
    <p>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. </p>
    
    <p>Exception Details: System.ComponentModel.Win32Exception: The system
    cannot find the file specified</p>
    
    <p>Source Error: </p>
    
    <p>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.</p>
    
    <p>Stack Trace: </p>
    
    <p>[Win32Exception (0x80004005): The system cannot find the file
    specified]</p>
    
    <p>[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.)]<br>
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection, Action<code>1 wrapCloseInAction)
    +5296071    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558<br>
    System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
    SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout,
    Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
    integratedSecurity, Boolean withFailover) +5308555<br>
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword,
    Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean
    withFailover) +145<br>
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo
    serverInfo, String newPassword, SecureString newSecurePassword,
    Boolean redirectedUserInstance, SqlConnectionString connectionOptions,
    SqlCredential credential, TimeoutTimer timeout) +920<br>
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer
    timeout, SqlConnectionString connectionOptions, SqlCredential
    credential, String newPassword, SecureString newSecurePassword,
    Boolean redirectedUserInstance) +307<br>
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, SqlCredential
    credential, Object providerInfo, String newPassword, SecureString
    newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString
    userConnectionOptions) +434<br>
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
    DbConnectionPool pool, DbConnection owningConnection,
    DbConnectionOptions userOptions) +225<br>
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
    pool, DbConnectionOptions options, DbConnectionPoolKey poolKey,
    DbConnectionOptions userOptions) +37<br>
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions
    userOptions) +558<br>
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions
    userOptions) +67<br>
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean
    allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions
    userOptions, DbConnectionInternal&amp; connection) +1052<br>
    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
    owningObject, TaskCompletionSource</code>1 retry, DbConnectionOptions
    userOptions, DbConnectionInternal&amp; connection) +78<br>
    System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection
    owningConnection, TaskCompletionSource<code>1 retry, DbConnectionOptions
    userOptions, DbConnectionInternal&amp; connection) +167<br>
    System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory,
    TaskCompletionSource</code>1 retry, DbConnectionOptions userOptions) +143<br>
    System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource<code>1
    retry) +83    System.Data.SqlClient.SqlConnection.Open() +96<br>
    System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection
    sqlConnection, Action</code>1 act) +79<br>
    System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection
    sqlConnection, Action`1 act) +384<br>
    System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection
    connection) +241<br>
    System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection
    connection) +26</p>
    
    <p>[ProviderIncompatibleException: The provider did not return a
    ProviderManifestToken string.]<br>
    System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection
    connection) +170<br>
    System.Web.Providers.ModelHelper.GetStorageMetadata(String
    providerName, DbConnection connection, String ssdl) +35<br>
    System.Web.Providers.ModelHelper.CreateMetadataWorkspace(String
    providerName, DbConnection connection, String csdl, String ssdl,
    String msl) +154<br>
    System.Web.Providers.ModelHelper.CreateEntityConnection(ConnectionStringSettings
    setting, String csdl, String ssdl, String msl) +109<br>
    System.Web.Providers.ModelHelper.CreateMembershipEntities(ConnectionStringSettings
    setting) +28<br>
    System.Web.Providers.DefaultMembershipProvider.GetPasswordWithFormat(String
    userName, Boolean updateLastLoginActivityDate, Int32&amp; status, String&amp;
    password, Int32&amp; format, String&amp; salt, Int32&amp;
    failedPasswordAttemptCount, Int32&amp; failedPasswordAnswerAttemptCount,
    Boolean&amp; isApproved, DateTime&amp; lastLoginDate, DateTime&amp;
    lastActivityDate) +118<br>
    System.Web.Providers.DefaultMembershipProvider.CheckPassword(String
    userName, String password, Boolean updateLastActivityDate, Boolean
    failIfNotApproved, String&amp; salt, Int32&amp; passwordFormat) +81<br>
    System.Web.Providers.DefaultMembershipProvider.ValidateUser(String
    username, String password) +105<br>
    System.Web.Security.Membership.ValidateUser(String username, String
    password) +26    Staff.Web.Account.Login.OnAuthenticate(Object sender,
    AuthenticateEventArgs e) in
    c:\Assembla\SVN\servicesdue\Staff.Web\Staff.Web\Account\Login.aspx.cs:28
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs
    e) +9449786    System.Web.UI.WebControls.Login.AttemptLogin() +119<br>
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs
    e) +75    System.Web.UI.Control.RaiseBubbleEvent(Object source,
    EventArgs args) +37<br>
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114<br>
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String
    eventArgument) +159<br>
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +10<br>
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +13<br>
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    +35    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +1724</p>
    
    <p>Version Information: Microsoft .NET Framework Version:4.0.30319;
    ASP.NET Version:4.0.30319.18055</p>
  </blockquote>
  
  <p>Someone also had this error and they said they were using the wrong store to connect to DB and hence the error. I only have one store in my code. There is no other. </p>
  
  <p>Update: </p>
  
  <p>I found the problem. It is membership related. Something is not right with my membership connection string. But I don't know what. My app requires registration so authentication is enabled. I left the default settings alone. Also published the mdf file in the App_Data folder. 
  There is a similar question here: <a href="https://stackoverflow.com/questions/974117/deploying-asp-net-membership-to-godaddy?rq=1">Deploying ASP.NET membership to Godaddy</a>. But the solution is not clear and the answer is marked. I added the 
      
  to the connection string and I see the error</p>
  
  <blockquote>
    <p>The connection name 'LocalSqlServer' was not found in the applications
    configuration or the connection string is empty.</p>
  </blockquote>
  
  <p>So, what should I do? This membership is working flawlessly locally.</p>
  
  <p>Update:</p>
  
  <p>I also tried what this one suggests <a href="https://stackoverflow.com/questions/1746068/godaddy-asp-net-membership-database-woes">Godaddy ASP.NET membership database woes</a>. I removed the conn string and added with the name "LocalSqlServer" to make Godaddy happy. Then I removed and added the following with this connectionStringName - DefaultProfileProvider, DefaultMembershipProvider, DefaultRoleProvider and DefaultSessionProvider. Still get the same error of system cannot find the specified file.</p>