views:

38

answers:

2

Hi,

I am trying to configure Entity Framework 4 in the Web.config file using this ConnectionString

...
metadata=
         res://*/CmsEntityDataModel.csdl|
         res://*/CmsEntityDataModel.ssdl|
         res://*/CmsEntityDataModel.msl;
....

I would like remove the "*" and add the actual path for my dll file. How to find the path for a dll in Visual Studio with no add-on? (I am pretty new in .net)

Thanks

+1  A: 

res://*/CmsEntityDataModel.csdl is a resource location, when you enter the actual path it points to a file on disk. This means that when deploying you need to have the file at that location on disk as well.

Having the metadata as an embedded resource and using the resource location is what I'd do, unless you have to be able to swap it out at some point without changing the dll.

See MSDN for more info

Sander Rijken
thanks i appreciate
GIbboK
+3  A: 

I've written a long explanation of EF metadata paths; you might find it helpful to read it.

You can replace the * with an assembly name, which might or might not be a strong name, like this:

<add name="MyEntities" connectionString="metadata=
        res://Simple Mvc.Data.dll/Model.csdl|
        res://Simple Mvc.Data.dll/Model.ssdl|
        res://Simple Mvc.Data.dll/Model.msl;provider= <!-- ... -->
Craig Stuntz