Click here to Skip to main content
13,354,885 members (69,915 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked
Posted 11 Nov 2010

Solution for "The underlying provider failed on Open" exception.

, 11 Nov 2010
Rate this:
Please Sign up or sign in to vote.
The underlying provider failed on Open Exception in WCF
As you guys know that I am posting enterprise architecture design article in code project here. While preparing third part, I started to implement simple tier application for demo. After completing server side implementation, I started to implement simple client for demo purpose. Once completed with client, i tried to run my demo application. But unfortunately I got the strange exception called "The underlying provider failed on Open". I googled more than an hour and found that most of the folks facing the same issue when they try to call the service which contains database access in local sql server through IIS. But no one is providing proper solution for this issue. Everyone says that IIS uses network credentials when it contacts sql server authentication process. So we should grant access to "NT AUTHORITY\NETWORK SERVICE" to your database.
But this is not the right solution and no one is saying how to fix the issue. After spending some hours, found the solution and my app running without any issues.

Here is the solution.

As folks mentioned IIS user network service user credentials while trying to log in sql server. So just change the Application pool settings in your IIS.

Step 1:
Open Internet Information Service Manager
Step 2:
Click on Application Pools in left navigation tree.
Step 3:
Select your version Pool. In my case, I am using ASP .Net v4.0. If you dont have this version, select DefaultAppPool.
Step 4:
Right click on step 3, and select advanced settings.
Step 5:
Select Identity in properties window and click the button to change the value.
Step 6:
Select Local System in Built-in accounts combo box and click ok.
That's it. Now run your application. Everything works well.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Logitech Engineering & Design (India) Pvt. Ltd.
India India
Venugopal works as a Senior Software Engineer in Logitech Engineering & Design (India) Pvt. Ltd. He hold a Masters in Computer Applications and has 4+ years experience in C#, XAML, Silverlight & WPF.

Venugopal firmly believes "technology is impermanent, change is not"!. While he has strong technical inclination towards MS technologies, he is deeply passionate about pursuing his career in Windows7-WPF and Silverlight Technology.

Venu engages in a wide gamut of temperamental hobbies ranging from making friends, traveling, helping his friends studies. To murmuring songs and watching movies in leisure time.

You may also be interested in...


Comments and Discussions

QuestionThis works but... Pin
mns16099-May-17 10:25
membermns16099-May-17 10:25 
GeneralNot Working Pin
SANDIP A PATIL21-Dec-16 2:11
memberSANDIP A PATIL21-Dec-16 2:11 
QuestionWorks!!! Pin
Uzay Ordu19-Nov-16 10:15
memberUzay Ordu19-Nov-16 10:15 
QuestionExcelente!!! Pin
Gilberto Ferreira22-Feb-16 10:59
memberGilberto Ferreira22-Feb-16 10:59 
SuggestionOther solution Pin
bhautik219198817-Dec-15 6:48
memberbhautik219198817-Dec-15 6:48 
QuestionIt works! Pin
pawelek_k23-Oct-15 4:41
memberpawelek_k23-Oct-15 4:41 
GeneralThank you Pin
Gani.P29-Jun-15 23:53
memberGani.P29-Jun-15 23:53 
QuestionYOU ARE MY HERO! Pin
Member 1056262111-May-15 3:46
memberMember 1056262111-May-15 3:46 
QuestionGot it Pin
Member 112529851-Dec-14 21:00
memberMember 112529851-Dec-14 21:00 
QuestionSuggest Manual Steps for web config Pin
Ashish Kumar kansal23-Sep-14 0:46
professionalAshish Kumar kansal23-Sep-14 0:46 
QuestionNice ticks Pin
Júnior Pacheco18-Aug-14 10:04
memberJúnior Pacheco18-Aug-14 10:04 
QuestionThanks Pin
vahidmir19-Feb-14 4:58
membervahidmir19-Feb-14 4:58 
GeneralMy vote of 5 Pin
Member 1016478029-Aug-13 2:14
memberMember 1016478029-Aug-13 2:14 
QuestionLogin - adding to User mapping Pin
MahanteshKaravekar4-Jul-13 0:53
memberMahanteshKaravekar4-Jul-13 0:53 
GeneralMy vote of 5 Pin
manoj.jsm12-Jun-13 23:12
membermanoj.jsm12-Jun-13 23:12 
GeneralMy vote of 5 Pin
MsBeigi12-Apr-13 23:41
memberMsBeigi12-Apr-13 23:41 
QuestionError coming when using Linq with oracle Pin
Er. Vikas Sangal23-Jan-13 1:03
memberEr. Vikas Sangal23-Jan-13 1:03 
GeneralMy vote of 2 Pin
Member 35080407-Nov-12 7:46
memberMember 35080407-Nov-12 7:46 
GeneralMy vote of 1 Pin
Member 184711219-Apr-12 14:29
memberMember 184711219-Apr-12 14:29 
Question[My vote of 1] Are you joking? Pin
Member 184711219-Apr-12 14:26
memberMember 184711219-Apr-12 14:26 
With advice like that I certainly wouldn't be checking out your architecture articles. You need to go back and check what the rights of the Local System user are, and then work out why you should NOT be setting an App Pool to run with those credentials.

The correct approach is to create a specific SQL or Windows login on the SQL server and use that for your database access, that way you can still continue to run your app pool with minimal rights and also set the appropriate rights at the database level.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 12 Nov 2010
Article Copyright 2010 by venugopalm
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid