【发布时间】:2013-12-26 02:51:55
【问题描述】:
我看到很多关于 SO 的问题都带有这个错误。但没有一个与形式有关。我只是在本地测试后托管了我的应用程序服务器。我认为它工作了几分钟,但我不确定,因为我可能已经看了一会儿 localhost 选项卡。然后它停止工作。当我也在服务器上进行更改时,我可能已经更改了一些内容。
我检查了我的连接字符串,并尝试使用其他方式登录数据库,它是在线的。所以,任何线索可能是错误的。我认为 sql server 不可能只是不响应来自应用程序的请求,并且如果您通过 SSMS 登录则可用。
以下是我得到的错误。
“/”应用程序中的服务器错误。
系统找不到指定的文件
描述:执行过程中发生了未处理的异常 当前的网络请求。请查看堆栈跟踪以获取更多信息 有关错误的信息以及它在代码中的来源。
异常详细信息:System.ComponentModel.Win32Exception:系统 找不到指定的文件
来源错误:
在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。
堆栈跟踪:
[Win32Exception (0x80004005): 系统找不到文件 指定]
[SqlException (0x80131904): 网络相关或实例特定 建立与 SQL Server 的连接时出错。这 服务器未找到或无法访问。验证实例 名称正确且 SQL Server 配置为允许远程 连接。 (提供者:SQL 网络接口,错误:52 - 无法 找到本地数据库运行时安装。验证 SQL Server Express 已正确安装并且本地数据库运行时 功能已启用。)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 异常,布尔 breakConnection,Action1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +5581 重试,DbConnectionOptions 用户选项,DbConnectionInternal& 连接)+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) +1671 重试, 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() +961 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 连接)+241
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接)+26[ProviderIncompatibleException: 提供者没有返回 ProviderManifestToken 字符串。]
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection 连接)+170
System.Web.Providers.ModelHelper.GetStorageMetadata(字符串 providerName,DbConnection 连接,字符串 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(字符串 userName, Boolean updateLastLoginActivityDate, Int32& status, String& 密码, Int32& 格式, String& salt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& 上次活动日期)+118
System.Web.Providers.DefaultMembershipProvider.CheckPassword(字符串 用户名、字符串密码、布尔值 updateLastActivityDate、布尔值 failIfNotApproved, String& salt, Int32& passwordFormat) +81
System.Web.Providers.DefaultMembershipProvider.ValidateUser(字符串 用户名,字符串密码)+105
System.Web.Security.Membership.ValidateUser(字符串用户名,字符串 密码)+26 Staff.Web.Account.Login.OnAuthenticate(对象发件人, AuthenticateEventArgs e) 在 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(对象源,EventArgs e)+75 System.Web.UI.Control.RaiseBubbleEvent(对象源, EventArgs 参数)+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(字符串 eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,字符串 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 membership to Godaddy。但解决方案不明确,答案已标记。我添加了 到连接字符串,我看到了错误
在应用程序中找不到连接名称“LocalSqlServer” 配置或连接字符串为空。
那么,我该怎么办?该成员在本地运行良好。
更新:
我也尝试了这个建议Godaddy ASP.NET membership database woes。我删除了 conn 字符串并添加了名称“LocalSqlServer”以使 Godaddy 高兴。然后,我使用此 connectionStringName 删除并添加了以下内容 - DefaultProfileProvider、DefaultMembershipProvider、DefaultRoleProvider 和 DefaultSessionProvider。还是出现系统找不到指定文件的错误。
【问题讨论】:
-
web.config 中的“defaultConnectionFactory”中有什么内容?我也可能有同样的问题,我相信它与 defaultConnectionFactory
-
我遇到了几个问题并解决了所有问题。不确定它是什么,但它与 defaultConnectionFactory 无关。我认为这个错误是我在配置中有 TrustedConnection=true 的地方。
标签: asp.net membership