0

I have a stange problem.

In my solution, I have a "Model" directory. In that directory, I have created an entity model. When I create the model (using the wizard), it creates a new entry for connection string in my app.config (which is at the solution level).

However when I try to access the entity object constructor using the default constructor, I get the error: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

I have a test application, where I have added a link to this app.config. From here I can access the entity object without any problem!

Thanks

1 Answer 1

6

Make sure the connection string is in the config file of the executing assembly. If you for instance use EF from af web site, you can copy the connection string from the app.config in the EF assembly to the web.config of the website assembly. Copy all of the connectionStrings-block:

<connectionStrings>
...
</connectionStrings>
Sign up to request clarification or add additional context in comments.

1 Comment

Yes thats what I was missing. just had to copy the connection string to web.config and it worked! Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.