To get it working for any type of app, these 2 steps are sufficient:
- Add the app.config of the EFW project to your app. If you already have a app.config, then add only the "connectionStrings" node of it.
- Copy the c/m/s (.csdl, .msl and .ssdl) files to the bin directory, where the executable of the app resides.
But if you have to get this working for a web app, then
- Add the "connectionStrings" node to your web app's web.config.
- Copy c/m/s files to App_Data folder
- Change the string in "connectionStrings" node From
Alternately, instead of "|DataDirectory|EFWSampleDb.csdl" you can also say "~\App_Data\EFWSampleDb.csdl". ("~" refers to the root directory of the web app). So, this essentially means that you can have the m/s/l files in any directory, and not necessarily in App_Data, and reference it in web.config.
Failing to do the above steps may error out saying:
"The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource."
"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient Provider, not valid."