views:

68

answers:

1

We have a class library (ProjA) which has L2E object context. This will be used in an Website (ProjB) and WCF Service (ProjC). How do I specify the connection string in the website (ProjB) web.config so that it uses the resource files from the class library project (ProjA).

connectionString="metadata=res://*/db.csdl|res://*/db.ssdl|res://*/db.msl;provider=System.Data.SqlClient;provider connection string="Data Source=localhost;Initial Catalog=db;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"

I tried replacing the * with ProjA all name, but it cant load that dll

A: 

The * should work just fine. That means "search all loaded assemblies." So as long as the library assembly is loaded before you attempt to instantiate an ObjectContext (which, in my experience, is true almost by definition) then the EDMX will be found.

Craig Stuntz
Thanks.I had a problem with the app.config file. Now it is working fine
Deepak N