在这篇文章中,我们将带领您了解asp.net–SQL网络接口,错误:26–定位服务器/实例指定错误的全貌,同时,我们还将为您介绍有关asp.net–IIS错误–HTTP错误500.24–内部服务器错误
在这篇文章中,我们将带领您了解asp.net – SQL网络接口,错误:26 – 定位服务器/实例指定错误的全貌,同时,我们还将为您介绍有关asp.net – IIS错误 – HTTP错误500.24 – 内部服务器错误、asp.net – 与SQL Server建立连接时出现网络相关或实例特定错误[已关闭]、asp.net – 如何解决“服务器错误在’/’应用程序”错误?、asp.net – 指定的CGI应用程序遇到错误,服务器终止进程的知识,以帮助您更好地理解这个主题。
本文目录一览:- asp.net – SQL网络接口,错误:26 – 定位服务器/实例指定错误
- asp.net – IIS错误 – HTTP错误500.24 – 内部服务器错误
- asp.net – 与SQL Server建立连接时出现网络相关或实例特定错误[已关闭]
- asp.net – 如何解决“服务器错误在’/’应用程序”错误?
- asp.net – 指定的CGI应用程序遇到错误,服务器终止进程
asp.net – SQL网络接口,错误:26 – 定位服务器/实例指定错误
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: 26 – Error Locating Server/Instance
Specified)
描述:
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.
例外详情:
System.Data.sqlClient.sqlException: 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: 26
– Error Locating Server/Instance Specified)
源错误:
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.
我尝试了很多东西,我在stackoverflow中发现了一些解决方案,但没有任何工作。这是我的连接字符串:
<connectionStrings> <clear/> <remove name="LocalsqlServer"/> <add name="LocalsqlServer" connectionString="Data Source=MSsql2008-1;Initial Catalog=agency; Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False; Packet Size=4096" providerName="System.Data.sqlClient" /> <add name="AgencyConn" connectionString="Data Source=MSsql2008-1;Initial Catalog=agency; Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False; Packet Size=4096" providerName="System.Data.sqlClient"/> </connectionStrings>
以下也是会员和角色管理器的web.config部分:
<membership defaultProvider="AuthProvider"> <providers> <clear/> <add name="AuthProvider" type="AuthenticationProvider" applicationName="~/Reserved/" connectionStringName="AgencyConn"/> </providers> </membership> <roleManager enabled="true" defaultProvider="MyRoleProvider"> <providers> <clear/> <add name="MyRoleProvider" type="RoleAccessprovider" connectionStringName="AgencyConn"/> </providers> </roleManager>
请问有谁能帮忙弄清楚出了什么问题?
解决方法
在机器B上:
1.打开名为“sql Server browser”的Windows服务并启动服务
2.)在Windows防火墙中,启用传入端口UDP 1434(如果机器A上的sql Server Management Studio正在连接或机器A上的程序正在连接)
3.)在Windows防火墙中,启用传入端口TCP 1433(如果有telnet连接)
4.)在sql Server配置管理器中,为端口1433启用TCP / IP协议
asp.net – IIS错误 – HTTP错误500.24 – 内部服务器错误
********************ERROR********************** HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. ********************ERROR********************** ********************Detailed Error information************** Module: ConfigurationValidationModule Notification: BeginRequest Handler: StaticFile Error Code: 0x80070032 Requested URL :http://localhost:80/ Physical Path :C:\inetpub\wwwroot logon Method :Not yet determined logon User :Not yet determined ************************
解决方法
>这是一个很好的explanation of the difference.
Classic mode is where IIS only works with ISAPI extensions and ISAPI filters directly … Integrated mode handles all requests through a unified pipeline for IIS and is tightly integrated with ASP.NET through that same pipeline.
>你可能遇到麻烦的地方:
Some legacy code may require that you run in classic mode to execute without error. To take full advantage of IIS we strongly encourage you to review your code if your application throws an error in Integrated but runs fine in Classic.
> Laundry list of issues调试集成模式.
asp.net – 与SQL Server建立连接时出现网络相关或实例特定错误[已关闭]
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: 26 - Error Locating Server/Instance 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.Data.sqlClient.sqlException: 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: 26 - Error Locating Server/Instance 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: [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: 26 - Error Locating Server/Instance Specified)] System.Data.sqlClient.sqlInternalConnection.OnError(sqlException exception,Boolean breakConnection,Action`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,TimeoutTimer timeout,Boolean withFailover) +145 System.Data.sqlClient.sqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,Boolean redirectedUserInstance,sqlConnectionString connectionoptions,sqlCredential credential,TimeoutTimer timeout) +920 System.Data.sqlClient.sqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout,Boolean redirectedUserInstance) +307 System.Data.sqlClient.sqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,Object providerInfo,sqlConnectionString userConnectionoptions) +434 System.Data.sqlClient.sqlConnectionFactory.CreateConnection(DbConnectionoptions options,DbConnectionPoolKey poolKey,Object poolGroupProviderInfo,DbConnectionPool pool,DbConnection owningConnection,DbConnectionoptions userOptions) +5311099 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool,DbConnectionoptions options,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`1 retry,DbConnectionInternal& connection) +78 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,DbConnectionInternal& connection) +167 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory,DbConnectionoptions userOptions) +143 System.Data.sqlClient.sqlConnection.TryOpen(taskcompletionsource`1 retry) +83 System.Data.sqlClient.sqlConnection.open() +96 Default.log(Object sender,EventArgs e) in c:\users\sreekanth\documents\visual studio 2010\Projects\IPCWebApp\IPCWebApp\Default.aspx.cs:43 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +124 System.Web.UI.WebControls.ImageButton.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) +1724
解决方法
>尝试使用管理工作室从服务器连接Sql Server。如果使用Windows身份验证连接Sql Server,则将应用程序池标识设置为服务器管理员。
>如果您使用sql server身份验证,那么请检查web应用程序的web.config中的连接字符串,并设置允许您登录的sql server的用户名和密码。
>如果您的数据库在其他服务器(访问远程数据库)中,则首先启用sql server的远程访问,从sql server management studio启动sql server属性,并启用TCP / IP表单sql server配置管理器。
>在完成所有这些内容后,您仍然无法访问数据库,然后检查要尝试访问数据库的服务器窗体的防火墙,并在防火墙中添加一个规则以启用sql server的端口(默认情况下,sql server使用1433,to检查sql server的端口,需要检查sql server配置管理器的网络协议TCP / IP端口)。
>如果您的sql server在命名实例上运行,则需要使用sql serer名称写入端口号,例如117.312.21.21/nameofsqlserver1433。
>如果您正在使用像amazon aws或microsoft azure这样的云托管服务器或实例将运行在云端防火墙后面,因此如果您有命名实例的sql server的默认实例或特定端口,则需要在云端防火墙中启用1433端口。
>如果您使用的是亚马逊RDS或sql azure,则需要从该实例的安全组启用端口。
>如果您通过sql server身份验证模式访问sql server,请确保启用了“sql Server和Windows身份验证模式”sql server instance属性。
>在对属性进行任何更改后重新启动sql server实例,因为某些更改将需要重新启动。
如果您进一步面对任何困难,那么您需要提供有关您的网站和sql服务器的更多信息。
asp.net – 如何解决“服务器错误在’/’应用程序”错误?
Server Error in '/' Application. ________________________________________ Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDeFinition='MachinetoApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. Source Error: Line 63: ASP.NET to identify an incoming user. Line 64: --> Line 65: <authentication mode="Windows"/> Line 66: <!--<forms loginUrl="~/SCR.UI/Login1.aspx"/> Line 67: </authentication>--> Source File: D:\BarclaysPayamentManagementSystem\scr.ui\web.config Line: 65
什么原因和如何解决?
请帮忙
解决方法
调试信息显示“该错误可能是由虚拟目录未被配置为IIS中的应用程序引起的.
但是,这个错误主要发生在2种情况中.
>当您使用visual studio.net创建新的Web应用程序时,它将自动创建虚拟目录并将其配置为应用程序.但是,如果手动创建虚拟目录并且未配置为应用程序,则无法浏览应用程序,并可能会收到上述错误.您所获得的调试信息如上所述适用于这种情况.
要解决它,右键单击虚拟目录 – 选择属性,然后单击
“创建”旁边的“应用程序”标签和文本框.它将使用虚拟目录的名称自动创建“应用程序”.现在可以访问应用程序.
>当您的应用程序中有子目录时,您可以使用子目录的web.config文件.但是,某些属性无法在子目录的web.config中设置,例如身份验证,会话状态(您可能会看到错误消息显示在web.config中声明身份验证或会话状态的行号的子目录).原因是这些设置无法在子目录级别被覆盖,除非子目录也被配置为应用程序(如上所述).
大多数情况下,如果我们想要保护对子目录文件的访问权限(例如,目录是admin,我们希望保护管理员页面免受无形资料的使用者),我们会在子目录中加入web.config.
asp.net – 指定的CGI应用程序遇到错误,服务器终止进程
解决方法
>导航到src / ProjectName / wwwroot
>打开web.config
>在httpPlatformremove中转发forwardWindowsAuthToken =“true / false”属性
重新部署和矿工作正常.
看到这里https://github.com/aspnet/Hosting/issues/364有很多讨论
关于asp.net – SQL网络接口,错误:26 – 定位服务器/实例指定错误的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于asp.net – IIS错误 – HTTP错误500.24 – 内部服务器错误、asp.net – 与SQL Server建立连接时出现网络相关或实例特定错误[已关闭]、asp.net – 如何解决“服务器错误在’/’应用程序”错误?、asp.net – 指定的CGI应用程序遇到错误,服务器终止进程的相关信息,请在本站寻找。
本文标签: