“該系統找不到指定的文件”
我看到很多關於這個錯誤的問題。但沒有一個與形式有關。我只是在本地測試後託管了我的應用程序伺服器。我認為它工作了幾分鐘,但我不確定,因為我可能已經看了一會兒 localhost 選項卡。然後它停止工作。當我也在伺服器上進行更改時,我可能已經更改了一些內容。
我檢查了我的連接字元串,還嘗試使用其他方式登錄數據庫,它是線上的。所以,任何線索可能是錯誤的。我認為 sql server 不可能僅不響應來自應用程序的請求,並且如果您通過 SSMS 登錄則可用。
以下是我得到的錯誤。
“/”應用程序中的伺服器錯誤。
該系統找不到指定的文件
說明:執行目前 Web 請求期間發生未處理的異常。請查看堆棧跟踪以獲取有關錯誤及其源自程式碼的位置的更多資訊。
異常詳細資訊:System.ComponentModel.Win32Exception:系統找不到指定的文件
源錯誤:
在執行目前 Web 請求期間生成了未處理的異常。可以使用下面的異常堆棧跟踪來辨識有關異常起源和位置的資訊。
堆棧跟踪:
[Win32Exception (0x80004005): 系統找不到指定的文件]
[SqlException (0x80131904):建立與 SQL Server 的連接時發生與網路相關或特定於實例的錯誤。伺服器未找到或無法訪問。驗證實例名稱是否正確以及 SQL Server 是否配置為允許遠端連接。(提供程序:SQL 網路介面,錯誤:52 - 無法找到本地數據庫執行時安裝。驗證 SQL Server Express 是否已正確安裝並且本地數據庫執行時功能已啟用。)]
System.Data.SqlClient.SqlInternalConnection.OnError( SqlException異常,Boolean breakConnection,Action 1 retry,DbConnectionOptions userOptions,DbConnectionInternal&connection) +78`1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558
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, TaskCompletionSource 1 retry, DbConnectionOptions userOptions) +143 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1 act) +79 System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection , Action
1 act) +384 System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken (DbConnection 連接) +241 System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 連接) +261 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +167System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry) +83 System.Data.SqlClient.SqlConnection.Open() +96System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`
[ProviderIncompatibleException: 提供者沒有返回 ProviderManifestToken 字元串。]
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(字元串 providerName,DbConnection 連接,字元串 csdl,字元串 ssdl,字元串 msl)+154
System.Web.Providers.ModelHelper.CreateEntityConnection(ConnectionStringSettings 設置,字元串 csdl,字元串 ssdl,字元串 msl)+109
System.Web.Providers.ModelHelper.CreateMembershipEntities(ConnectionStringSettings 設置)+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(字元串事件參數)+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(布爾includeStagesBeforeAsyncPoint,布爾includeStagesAfterAsyncPoint)+1724
版本資訊:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.18055
有人也有這個錯誤,他們說他們使用錯誤的儲存連接到數據庫,因此出現錯誤。我的程式碼中只有一家商店。沒有其他的。
更新:
我發現了問題。它與會員資格有關。我的會員連接字元串有問題。但我不知道是什麼。我的應用程序需要註冊,因此啟用了身份驗證。我保留了預設設置。還在 App_Data 文件夾中發布了 mdf 文件。這裡有一個類似的問題:Deploying ASP.NET members to Godaddy。但解決方案不明確,答案已標記。我添加到連接字元串,我看到了錯誤
在應用程序配置中找不到連接名稱“LocalSqlServer”或連接字元串為空。
所以我該怎麼做?該會員資格在本地完美執行。
更新:
我還嘗試了這個建議Godaddy ASP.NET 會員數據庫的問題。我刪除了 conn 字元串並添加了名稱“LocalSqlServer”以使 Godaddy 高興。然後,我使用此 connectionStringName 刪除並添加了以下內容 - DefaultProfileProvider、DefaultMembershipProvider、DefaultRoleProvider 和 DefaultSessionProvider。仍然得到相同的系統找不到指定文件的錯誤。
建立與 SQL Server 的連接時發生與網路相關或特定於實例的錯誤。伺服器未找到或無法訪問。文本
通常,此類問題與需要查看的以下任何一項有關:
- 從 Web 伺服器到數據庫伺服器的防火牆設置
- 連接字元串錯誤
- 啟用適當的協議管道/ tcp-ip
嘗試在安裝了 sql server 的系統上使用 sql management server 連接到 sql server 並從那里工作。注意錯誤日誌中的資訊。