New Posts New Posts RSS Feed: Prism Explorer app.config files
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Prism Explorer app.config files

 Post Reply Post Reply
Author
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Topic: Prism Explorer app.config files
    Posted: 24-Sep-2009 at 12:40pm
I've just started working with DevForce for Silverlight and I've been reviewing the Prism Explorer example project.  I'm confused by the location of the app.config files in the various projects that make up the solution.  There is an app.config file only in the PrismExplorer.Shell project.  Why isn't there an app.config file in the ModelExplorer.ModelDF project?  I've read through the "Understanding the App.Configs" section of the DevForce v5.2.2 Developer Guide and it seems as if there should be an app.config file in this project.
Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post Posted: 24-Sep-2009 at 1:17pm
There would be an app.config in ModelExplorer.ModelDF by default.  That's the way comes out-of-the-box from the DevForce Object Mapper (OM) with its default settings.
 
However, the only Silverlight CLIENT app.config that DevForce needs ... or uses ... is the one in the Silverlight application project ... which is the "Shell" project in Prism Explorer.
 
People get really confused when there are a bunch of app.configs around. I had already moved the OM generated app.config to the Silverlight application project (or maybe OM did it automatigically ... I don't remember).
 
I didn't need one in "ModelDF" anymore. So I removed this unnecessary config and I told the Object Mapper not to create a new one (there's a check box for that).
 
There is one more app.config hanging around; it's in the ModelExplorer.ModelEF project. That one is for EntityFramework's own use; DevForce does not see or care about it.
 
Aside: if your DevForce and Entity Framework are in the same project, they can share the same app.config and there will be one there at least for EF's use. Just remember, DevForce only cares about the app.config in the APPLICATION project; thus, the app.config that supports Entity Framework doesn't have to have any DevForce in it at all.
 
Finally, there is the web.config in the SERVER project which serves the same purpose as an app.config. You will find that it has some of the material (the EDMKeys) that is in the CLIENT app.config. Of course it does *not* have connection strings; these are only needed ... and should only appear ... on the server-side.
 
Summary:
 
It is easy to accumulate confusing and unnecessary configuration files. All you really need are:
  • app.config in the Silverlight client application project
  • app.config in the EntityFramework project (for EF purposes)
  • web.config in the server project.


Edited by WardBell - 24-Sep-2009 at 1:20pm
Back to Top
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Posted: 25-Sep-2009 at 8:42am
Thank you for the explanation Ward!  I'm working on writing my own sample application utilizing Prism and Devforce and your explanation got me over the config file hurdle I was experiencing.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down