none
The network path was not found RRS feed

  • Question

  • Line 367:                            LastName = u.LastName
    Line 368:                        };
    Line 369:            return users.ToList();
    Line 370:        }
    Line 371:
    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)]
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5340635
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +244
       System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +5350895
       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) +891
       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, SessionData reconnectSessionData) +518
       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +278
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +38
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +732
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +85
       System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1057
       System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
       System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +196
       System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +146
       System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +16
       System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +94
       System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +110
       System.Data.SqlClient.SqlConnection.Open() +96
       System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +44
    
    [EntityException: The underlying provider failed on Open.]
       System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +203
       System.Data.EntityClient.EntityConnection.Open() +104
       System.Data.Objects.ObjectContext.EnsureConnection() +75
       System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +41
       System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +36
       System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator() +126
       System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator() +99
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
       InCubatize.Controllers.UserAPIController.GetUserTokens() in f:\Incubatize-local-version\Incubatize\InCubatize\Controllers\UserAPIController.cs:369
       InCubatize.Helpers.CommonFunctions.SetUserTokensInAppObject() in f:\Incubatize-local-version\Incubatize\InCubatize\Helpers\CommonFunctions.cs:294
       InCubatize.MvcApplication.Application_Start() in f:\Incubatize-local-version\Incubatize\InCubatize\Global.asax.cs:33
    
    [HttpException (0x80004005): The underlying provider failed on Open.]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9905689
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
    
    [HttpException (0x80004005): The underlying provider failed on Open.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885044
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
    

    Wednesday, June 4, 2014 5:58 PM

All replies

  • Either your EF connectionstring is wrong,  or the EF connectionstring is not in the right config file and .NET can't find the connectionstring.
    • Proposed as answer by ErikEJMVP Wednesday, June 4, 2014 7:40 PM
    Wednesday, June 4, 2014 6:36 PM
  • I have downloaded this code from TFS server and copied in local folder. I need to make some changes in my project but when i am running it then its is showing me the error of "Network Path was not found".

    Would you please suggest what could be wrong in connectionstring.

    Thursday, June 5, 2014 3:24 PM
  • What version of EF is this and what type of application is trying to use EF?
    Thursday, June 5, 2014 3:47 PM
  • EF version is 6.1.0 and it is a web application.  I made some changes in Webconfig file and also commented the transform tag. But still i am getting the same error.
    Friday, June 6, 2014 3:05 AM
  • What I think you futher need to do is put a try/catch around the code in error and do an ex.ToString() on the exception being thrown so that you can see the inner exception message if any.

    http://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx

    Friday, June 6, 2014 3:06 PM