1

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?

Thanks

GibboK
  • 71,848
  • 143
  • 435
  • 658
  • Why bother changing it if it works as is? – Brian Mains Sep 09 '10 at 15:56
  • 2
    Hi Brian, sorry I am learning for me would be very useful understand how does it work. also i suppose "*" increase overhead cause the compiler has to scan every dll. please let me know if you know how to do it. thanks for your time – GibboK Sep 09 '10 at 15:59
  • It's not very clear what your question is. I answered with what the * construct does. I'm not sure what you mean by finding the path for a dll with no add-on – Sander Rijken Sep 09 '10 at 16:11
  • The question is pretty related to your other one: http://stackoverflow.com/questions/3675090/metadata-related-exception-when-using-entity-framework-4 – Sander Rijken Sep 09 '10 at 16:16
  • The work to find the correct assembly when you use `*` is done at runtime, not at compile time. – Craig Stuntz Sep 10 '10 at 12:35

2 Answers2

3

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
  • 125,891
  • 12
  • 252
  • 273
1

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
  • 21,376
  • 3
  • 61
  • 85