Fernando Correia
Fernando Correia

Reputation: 22365

How to specify a connection string on a WCF project that uses Entity Framework code first?

Considering a Visual Studio 2010 solution with:

How should the connection string for a remote SQL Server database be specified in the WCF project so that Entity Framework 4.1 will be able to access this database?

Upvotes: 1

Views: 498

Answers (1)

Wouter de Kort
Wouter de Kort

Reputation: 39898

You need to add the connection string to the web.config of the WCF project.

It doesn't matter that the EF is declared in a referencing assembly. The configuration is always loaded from the current process, which in this case is the WCF project.

Upvotes: 2

Related Questions