Home > Uncategorized > System.Data.ProviderIncompatibleException Exception with Entity Framework Power Tools Beta 2 and Beta 3

System.Data.ProviderIncompatibleException Exception with Entity Framework Power Tools Beta 2 and Beta 3

February 5, 2013 Leave a comment Go to comments

Got stuck on this last night, when using Entity Framework Power Tools Beta 3, note: exception also happens in Beta 2 (http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d) to generate our POCO’s with Entity Framework 5.

Exception:

System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. —> System.InvalidOperationException: This operation requires a connection to the ‘master’ database. Unable to create a connection to the ‘master’ database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection. —> System.Data.SqlClient.SqlException: Login failed for user ‘blah’.

2-5-2013 6-31-42 PM

After falling in the rabbit hole of thinking it was a security issue and tweaking security in SSMS, well security wasn’t the issue, as long as the same SQL Account had rights to the master database, which it already did.

Solution: When you use the Entity Framework Power Tools, you have to check “Save Password” under “Connection Properties” and set “Persist Security Info” to true under “Advanced Properties. if you are using SQL Server Authentication. The tool is just using the standard SQL authentication dialog box, which has this checkbox, however it doesn’t save any of your credential information anywhere, so don’t expect anything to be pre-filled the next time you run the tool and get prompt for credentials.

  • Connection Properties

    2-5-2013 6-25-24 PM
  • Advanced Properties

    2-6-2013 11-39-07 AM

Why? Well when you run Entity Framework Power Tools to generate your POCO’s/data layer, it needs to access additional schema meta-data in your master database for the target database you are trying to generate for. This is obviously a bug, however if you don’t check “Save Password” then it doesn’t keep the password around when it authenticates with the master database for the schema or other related info it needs and therefore this exception. If you continue reading the stack trace, you will see that it states:

Unable to create a connection to the ‘master’ database because the original database connection has been opened and credentials have been removed from the connection string.

I googled and googled with no luck, and after fortunately finding out how to get around this, well hence this blog post. So for those that need to generate your model against a database that’s already in production with CodeFirst not being a viable solution, and getting this exception, here you go.

Happy Coding! :)

About these ads
Categories: Uncategorized
  1. March 14, 2013 at 3:38 am | #1

    Thank you folks. This info is proving extremely useful.

    Eprocbell

    • Le
      March 20, 2013 at 10:56 pm | #2

      You bet! thanks for stopping by :)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 124 other followers

%d bloggers like this: