我看到了很多有關此錯誤的問題。但沒有一個與形式有關。我在本地測試後託管了我的應用程序服務器。我認爲它工作了幾分鐘,但我不確定,因爲我可能已經看了一會兒localhost標籤。然後它停止工作。當我在服務器上進行更改時,我可能已經改變了一些東西。「系統找不到指定的文件」
我檢查了我的連接字符串,並嘗試使用其他方式登錄到數據庫,它在線。所以,任何線索可能是錯的。我不認爲有可能sql服務器只響應來自應用程序的請求,並且如果您通過SSMS登錄則可用。
下面是我得到的錯誤。
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:
[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, Action1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +5308555
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +145
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +920
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +307
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +434
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +225
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +37
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +558
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +67
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1052
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +167
1 retry, DbConnectionOptions userOptions) +143
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) +83 System.Data.SqlClient.SqlConnection.Open() +96
1 act) +79
System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action
System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +384
System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +241
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +26[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +170
System.Web.Providers.ModelHelper.GetStorageMetadata(String providerName, DbConnection connection, String ssdl) +35
System.Web.Providers.ModelHelper.CreateMetadataWorkspace(String providerName, DbConnection connection, String csdl, String ssdl, String msl) +154
System.Web.Providers.ModelHelper.CreateEntityConnection(ConnectionStringSettings setting, String csdl, String ssdl, String msl) +109
System.Web.Providers.ModelHelper.CreateMembershipEntities(ConnectionStringSettings setting) +28
System.Web.Providers.DefaultMembershipProvider.GetPasswordWithFormat(String userName, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& format, String& salt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +118
System.Web.Providers.DefaultMembershipProvider.CheckPassword(String userName, String password, Boolean updateLastActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +81
System.Web.Providers.DefaultMembershipProvider.ValidateUser(String username, String password) +105
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
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +75 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +159
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055
有人也有過這樣的錯誤,他們說,他們使用了錯誤的店來連接到數據庫,因此錯誤。我的代碼中只有一家商店。沒有其他。
更新:
我發現了這個問題。它與會員有關。有些東西與我的會員連接字符串不符。但我不知道是什麼。我的應用需要註冊才能啓用身份驗證。我只保留了默認設置。還在App_Data文件夾中發佈了mdf文件。 這裏有一個類似的問題:Deploying ASP.NET membership to Godaddy。但解決方案並不明確,答案已標出。我加入了 連接字符串和我看到的錯誤
The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.
所以,我應該怎麼辦?這個會員資格在當地是完美無缺的。
更新:
我也試過這是什麼人建議Godaddy ASP.NET membership database woes。我刪除了conn字符串,並添加了名稱「LocalSqlServer」,以使Godaddy快樂。然後我刪除並添加以下這個connectionStringName - DefaultProfileProvider,DefaultMembershipProvider,DefaultRoleProvider和DefaultSessionProvider。仍然得到相同的系統錯誤找不到指定的文件。
web.config中的'defaultConnectionFactory'是什麼?我也可能有同樣的問題,我相信它與defaultConnectionFactory –
我遇到了幾個問題,並解決了所有問題。不知道它是什麼,但它與defaultConnectionFactory沒有任何關係。我認爲這個錯誤是我在配置中擁有TrustedConnection = true的地方。 – strider