title: Network path was not found error during site access
body: <p>I just migrated my asp.net website from one host to another. It was working fine with the old host but with the new host there is this error:</p>
  
  <pre><code>Server Error in '/' Application.
  
  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)]
     mainclass.SendValue(String str) +296
     _Default.Page_Load(Object sender, EventArgs e) +57
     System.Web.UI.Control.OnLoad(EventArgs e) +92
     System.Web.UI.Control.LoadRecursive() +54
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446
  </code></pre>
  
  <p>Again my new host says that there is some issue with the web.config file and I should get in touch with the developer. Now since I have migrated from their service. there is no backup support and they are not responding. I have managed to trace the web.config file in my backup but could not understand the error.</p>
  
  <p>Code attached below:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;
      &lt;configSections&gt;
          &lt;!--sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
              &lt;sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
                  &lt;section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
                  &lt;sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
                      &lt;section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/&gt;
                      &lt;section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
                      &lt;section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/&gt;
                  &lt;/sectionGroup&gt;
              &lt;/sectionGroup&gt;
          &lt;/sectionGroup--&gt;
      &lt;/configSections&gt;
     &lt;system.web&gt;
     &lt;machineKey 
  validationKey="D71C0822208030C075FB3D1E4AF6E14CBB186B6C5EF1475AB48C7450235663228A4AECF3E61FFF67A0251B10B16E8CA77D38C8F6B6F03FE9E42BC5077FCAE751"
  decryptionKey="4606DACD38CBFFA7B62195A0A08F07108C2734556461F42CC86EEF86A257CB57"
  validation="SHA1" decryption="AES"
  /&gt;
          &lt;sessionState regenerateExpiredSessionId="true" cookieless="false" timeout="60" mode="InProc"/&gt;
          &lt;!--profile&gt;
              &lt;properties&gt;
                  &lt;add name="SearchTerms" type="System.Collections.Specialized.StringCollection" serializeAs="Xml"/&gt;
              &lt;/properties&gt;
          &lt;/profile&gt;
          &lt;securityPolicy&gt;
              &lt;trustLevel name="full" policyFile="Web_mediumtrust.config"/&gt;
          &lt;/securityPolicy--&gt;
          &lt;compilation debug="true" strict="false" explicit="true"&gt;
              &lt;assemblies&gt;
                  &lt;!--add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/--&gt;
                  &lt;add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
                  &lt;add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
                  &lt;!--add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/--&gt;
                  &lt;add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;&lt;/assemblies&gt;
          &lt;/compilation&gt;
          &lt;pages validateRequest="false" enableEventValidation="false"&gt;
              &lt;namespaces&gt;
                  &lt;clear/&gt;
                  &lt;add namespace="System"/&gt;
          &lt;add namespace="System.Data"/&gt;
          &lt;add namespace="System.IO"/&gt;
          &lt;add namespace="System.Collections"/&gt;
                  &lt;add namespace="System.Collections.Specialized"/&gt;
                  &lt;add namespace="System.Configuration"/&gt;
                  &lt;add namespace="System.Text"/&gt;
                  &lt;add namespace="System.Text.RegularExpressions"/&gt;
                  &lt;add namespace="System.Web"/&gt;
                  &lt;add namespace="System.Web.Caching"/&gt;
                  &lt;add namespace="System.Web.SessionState"/&gt;
                  &lt;add namespace="System.Web.Security"/&gt;
                  &lt;add namespace="System.Web.Profile"/&gt;
                  &lt;add namespace="System.Web.UI"/&gt;
                  &lt;add namespace="System.Web.UI.WebControls"/&gt;
                  &lt;add namespace="System.Web.UI.WebControls.WebParts"/&gt;
          &lt;add namespace="System.Web.UI.HtmlControls"/&gt;
          &lt;add namespace="System.Data.SqlClient"/&gt;
          &lt;add namespace="System.Net"/&gt;
          &lt;add namespace="System.Net.Mail"/&gt;
        &lt;/namespaces&gt;
        &lt;controls&gt;
          &lt;!--add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/--&gt;
                  &lt;add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/&gt;
          &lt;add namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2" tagPrefix="fckeditorv2"/&gt;
              &lt;/controls&gt;
          &lt;/pages&gt;
          &lt;authentication mode="Windows"/&gt;
          &lt;customErrors mode="Off"/&gt;
          &lt;authorization&gt;
              &lt;allow users="*"/&gt;
          &lt;/authorization&gt;
          &lt;httpHandlers&gt;
              &lt;remove path="*.asmx" verb="*"/&gt;
              &lt;!--add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/&gt;
              &lt;add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/&gt;
              &lt;remove verb="*" path="*.asmx"/&gt;
              &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
              &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
              &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/--&gt;
          &lt;/httpHandlers&gt;
          &lt;httpModules&gt;
              &lt;!--add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/--&gt;
          &lt;/httpModules&gt;
      &lt;/system.web&gt;
      &lt;appSettings&gt;
      &lt;add key="dsn_SQL" value="LVgWRIoUlompcYzQ00rAG8jPgxmL4tk6ifMm1jAfAZk4vkknXwwr7vMGSq7RkOdwmJfu7Mp+9C+jPlSPMoVltKm6fWHqdBel4Bzhb7jvNfQuDUmNZLRqu2aiSPHuXJh+"/&gt;
            &lt;!--From Mail Server--&gt;
      &lt;add key="mailserver" value="127.0.0.1" /&gt;
      &lt;add key="FCKeditor:UserFilesPath" value="~/uploads/" /&gt;
      &lt;/appSettings&gt;
      &lt;system.webServer&gt;
          &lt;validation validateIntegratedModeConfiguration="false"/&gt;
          &lt;modules&gt;
              &lt;add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
          &lt;/modules&gt;
          &lt;handlers&gt;
              &lt;remove name="WebServiceHandlerFactory-Integrated"/&gt;
              &lt;!--add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
              &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
              &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/--&gt;
          &lt;/handlers&gt;
  
          &lt;!--directoryBrowse enabled="false" /&gt;
          &lt;defaultDocument&gt;
              &lt;files&gt;
                  &lt;clear /&gt;
                  &lt;add value="Default.htm" /&gt;
                  &lt;add value="Default.asp" /&gt;
                  &lt;add value="index.htm" /&gt;
                  &lt;add value="Default.aspx" /&gt;
                  &lt;add value="index.php" /&gt;
                  &lt;add value="index.html" /&gt;
              &lt;/files&gt;
          &lt;/defaultDocument--&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>