Home » Articles | Entity Framework

Entity Framework - ArgumentException on Connection

22. October 2008 by Juliën Hanssens 3 Comments

A common error while initialising an EntityModel from a WCF Service is the following message:

ArgumentException was unhandled by user code
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

Or more visual, as below, where you can see it doesn't dig the constructor built by the designer:

securancy.com_app_config_missing_or_incorrect_cstring

There is a pretty large chance that the reasons (and resolutions) for this problem are on the following:

  1. Reason: Missing or incorrect <connectionStrings> section in App.config
    Resolution: Add the right connectionString to the file
  2. Reason: Screwed up App.config file
    Resolution: remove and then re-reference the WCF service
  3. Reason: Driver issue
    Resolution: Take it up with your (presumably third party ) driver provider

Comments

trackback
RealDolmen blogs said:

Trackback from RealDolmen blogs

New Entity Framework / LINQ blog!

Aaron
United States Aaron said:

I resolved this error when I copied the app.config from them project with the entity model into my test harness project.

jernej
Slovenia jernej said:

I'm also getting this error, but not in runtime. I get this error when I create a User Control in my Windows application, and this user control has a initialization call(in constructor) for my Entity Client model. When I try to drag and drop this control to a form in VS designer VS displays this error

Comments are closed