【问题标题】:The system cannot find the file specified in Windows Server 2012系统找不到 Windows Server 2012 中指定的文件
【发布时间】:2015-02-02 10:12:36
【问题描述】:

我检查了很多参考网站来解决这个问题,但没有人给出正确的解决方案。我在 Windows Server 2008/2012 上托管了我的应用程序,但它无法正常工作。

实际上它在本地系统上运行良好,但发布后,我将这个应用程序托管在服务器上,然后它就无法运行。

以下是错误详情。

系统找不到指定的文件。

说明:在执行当前 Web 请求期间发生未处理的异常 enter code here。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详情:System.ComponentModel.Win32Exception:系统找不到指定的文件

来源错误: 在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常来源和位置的信息。

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

  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 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions
  userOptions, DbConnectionInternal& connection) +167

  System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection
  outerConnection, DbConnectionFactory connectionFactory,
  TaskCompletionSource1 retry, DbConnectionOptions userOptions) +143
System.Data.SqlClient.SqlConnection.TryOpen(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(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.

【问题讨论】:

  • 你的连接字符串正确吗?

标签: c# asp.net sql-server-2012


【解决方案1】:

正如您在堆栈跟踪中看到的那样。它告诉你问题。很可能,您与数据库的连接已关闭,或者您无法连接数据库服务器。

“发生网络相关或特定于实例的错误,同时 建立与 SQL Server 的连接。找不到服务器或 无法访问。验证实例名称是否正确,并且 SQL Server 配置为允许远程连接。 (提供者:SQL 网络接口,错误:52 - 无法找到本地数据库 运行时安装。验证 SQL Server Express 是否正确 已安装并且本地数据库运行时功能已启用。)]"

您需要进一步研究:

1] Firewall settings 从 Web 服务器到数据库服务器
2] 连接字符串错误
3]启用适当的协议管道/ tcp-ip
4]检查SQL Server service是否运行

【讨论】:

  • 我已经尝试过这个东西并检查过了。请为此提供其他解决方案,因为在应用这个东西之后它没有解决这个错误。
  • 您是否在堆栈跟踪中看到了这一点。这完全取决于您的数据库连接字符串。 “在建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误。找不到服务器或无法访问该服务器。验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接。 (提供者:SQL 网络接口,错误:52 - 无法找到本地数据库运行时安装。验证 SQL Server Express 已正确安装并且本地数据库运行时功能已启用。)]"
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-22
  • 2019-08-03
  • 2014-03-16
  • 1970-01-01
相关资源
最近更新 更多