网络路径未找到 [英] The network path was not found

查看:337
本文介绍了网络路径未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑我的code和收到此错误。但是,这是什么意思?

  

网络路径找不到说明:未处理的异常   当前Web请求的执行过程中发生。请   检查堆栈跟踪有关该错误以及详细信息   它起源于code。

     

异常详细信息: System.ComponentModel.Win32Exception:网​​络路径未找到

源错误:

  

中的执行过程中生成了未处理的异常   当前Web请求。有关的起源和位置信息   除了可以使用下面的异常堆栈跟踪信息确定。

堆栈跟踪:

  
    

[Win32Exception(0X80004005):网络路径找不到]

         

[SQLEXCEPTION(0x80131904):建立SQL Server的连接时出现与网络相关的或特定于实例的错误。该     服务器找不到或无法访问。验证实例     名称是否正确,以及SQL Server配置为允许远程     连接。 (provider:命名管道提供程序,error:40 - 无法     打开SQL Server的连接)]

  
解决方案

这可能与你的数据库的连接字符串或类似的东西。

我刚刚解决了这个例外现在。发生的事情是,我使用的是的连接字符串的意图在不同的机器(服务器)调试时使用。

我评论了错误的连接字符串的在的Web.config 并取消注释是正确的。现在我回到了业务......这是我忘了看后一段时间没有工作在一个给定的解决方案。 ;)

I'm running my code and getting this error. But what does it mean?

The network path was not found 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.ComponentModel.Win32Exception: The network path was not found

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:

[Win32Exception (0x80004005): The network path was not found]

[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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

解决方案

This is probably related to your database connection string or something like that.

I just solved this exception right now. What was happening is that I was using a connection string intended to be used when debugging in a different machine (the server).

I commented the wrong connection string in Web.config and uncommented the right one. Now I'm back in business... this is something I forget to look at after sometime not working in a given solution. ;)

这篇关于网络路径未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆