我看到了许多问题,因此有了这个错误。但是没有一个与形式有关。在本地测试后,我刚刚托管了我的应用程序服务器。我认为它工作了几分钟,但我不确定,因为我可能已经看过Local -Host选项卡了片刻。然后它停止工作。当我在服务器上进行更改时,我可能已经更改了一些事情。

我检查了我的连接字符串,并尝试使用其他方式登录数据库,它是在线的。

以下是我遇到的错误。

服务器错误中的"/“应用程序中的错误。

该系统找不到指定的文件

描述:执行当前Web请求期间发生了一个未经治疗的例外。请查看堆栈跟踪,以获取有关该错误以及代码中何处的更多信息。

Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified

源错误:

在执行当前的Web请求期间生成了一个未指导的例外。可以使用下面的异常堆栈跟踪来识别有关异常的原点和位置的信息。

堆栈跟踪:

[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
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, TaskCompletionSource1重试,dbConnectionOptions用户,dbConnection Internal&Connection)+78
system.data.providerbase.dbconnectionfactory.trygetConnection(dbConnection Conconnection,taskCompletionsource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +167
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1重试,dbConnectionOptions用户)+143
system.data.sqlclient.sqlconnection.troopen(taskCompletionsource1 retry) +83 System.Data.SqlClient.SqlConnection.Open() +96
System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action1 ACT)+79
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(字符串providername,dbConnection连接,字符串SSDL)+35
system.web.providers.modelhelper.createmetadataworkspace(字符串providername,dbConnection连接,字符串CSDL,字符串SSDL,字符串SSDL,字符串MSL)+154
system.web.providers.modelhelper.createentityConnection(ConnectionStringSettings设置,字符串CSDL,字符串SSDL,字符串MSL)+109
system.web.providers.modelhelper.createmembershipities(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(字符串用户名,字符串密码,布尔usean updatelastactivitydate,boolean fairifnotappraved,字符串和盐,int32&passwordformat)+81
system.web.providers.defaultmembershipprovider.validateuser(字符串用户名,字符串密码)+105
system.web.security.membership.valitesuser(字符串用户名,字符串密码)+26 sext.web.account.login.onauthenticate(对象发送者,authenticateEventArgs e)在c:\ insembla \ soverbla \ svn \ svn \ svn \ svn \ servicesdue \ services due \ severs.web.web \ fersect中。Web \ Account \ login.aspx.cs:28 System.Web.ui.WebControls.login.onauthenticate(authenticateEventargs e)+9449786 System.web.ui.web.ui.webcontrols.logins.login.login.AttEmptlogin()+119()+119()+119()+119()+119
system.web.ui.webcontrols.login.onbubbleevent(对象源,EventArgs E)+75 System.Web.ui.Control.Control.RaiseBubbleVent(对象源,Evestargs 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(namesValueCollection postdata)+35 System.web.ui.page.page.processrequestmain(boolean includeStagesBeforeSyncpoint,boolean includeSages foreanncpoint

版本信息:Microsoft .NET框架版本:4.0.30319;ASP.NET版本:4.0.30319.18055

有人也遇到了这个错误,他们说他们正在使用错误的商店连接到DB,因此错误。我的代码中只有一家商店。没有其他。

更新:

我发现了这个问题。这与会员有关。我的会员连接字符串不正确。但是我不知道。我的应用需要注册,以便启用身份验证。我独自离开默认设置。还在App_Data文件夹中发布了MDF文件。这里有一个类似的问题:部署ASP.NET会员资格。但是解决方案尚不清楚,答案是标记的。我添加了连接字符串,我看到了错误

连接名称” localsqlserver"在应用程序配置或连接字符串为空中找不到。

所以我该怎么做?该会员资格在本地完美地工作。

更新:

我也尝试了这个建议Godaddy ASP.NET会员数据库困扰。我删除了Conn字符串,并添加了名称" LocalsQlserver",以使Godaddy快乐。然后,我删除并使用此ConnectionStringName -DefaultProfileProvider,Default -MembershippRovider,DefaultroleProvider和DefaultSessionProvider添加了以下内容。仍然获得相同的系统错误找不到指定的文件。

答案

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. text

一般来说,此类问题与以下任何一个需要考虑的问题有关:

  • 从 Web 服务器到数据库服务器的防火墙设置
  • 连接字符串错误
  • 启用适当的协议管道/ tcp-ip

尝试使用安装了 sql server 的系统上的 sql 管理服务器连接到 sql server 并从那里开始工作。

来自: stackoverflow.com