New Posts New Posts RSS Feed: prism and moving the designer.cs file to its own project
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

prism and moving the designer.cs file to its own project

 Post Reply Post Reply
Author
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Topic: prism and moving the designer.cs file to its own project
    Posted: 28-Oct-2009 at 10:15am
Why don't you zip up your entire solution and send it to us (IdeaBladeSupportTrack@) and we'll get this straightened out.
Back to Top
jmcfet View Drop Down
Newbie
Newbie


Joined: 10-Oct-2009
Posts: 5
Post Options Post Options   Quote jmcfet Quote  Post ReplyReply Direct Link To This Post Posted: 15-Oct-2009 at 6:31am
Sorry I tried your suggestions and ended up with directory called DomainModelSL in my Silverlight stuff and it contains a designer.cs file as generated by the mapper. I found this a wierd process as initailly there was no way to specify a location for the SL designer.cs in the mapper dialog. I then let it save the defaults and then went back into the mapper tool and now the options appear. this does not seem right as I now have a designer.cs file in Shared and my new DomainModelSL. Anyways being stubborn I persisted and as a test I just added :

DomainModelEntityManager _manager = new DomainModelEntityManager(false);

to one of startup files to see if there was hope, well there was none as I get the dreaded execption:
Error: Unhandled Error in Silverlight Application
Code: 2028   
Category: ParserError      
Message: The name already exists in the tree: BaseWizard.    
File:     
Line: 0    
Position: 0  
 
I wasting too much time so am switching to Ria services , I wanted to try your stuff out and must also say that it looks great in simple cases but too hard to use in more robust architectures. I have the same thing working in Ria so will continue on that path as it is free and works with linq to SQL
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 14-Oct-2009 at 4:15pm
Instead of moving the generated output file, just move the ibedmx file to the non-SL project of your choice.  If you do this manually you'll also have to manually edit the relative path information (the path to the EDMX file) stored in the ibedmx.  An easier way of doing this is by using the Object Mapper to target the projects you want: it will allow you to choose both the Silverlight and non-Silverlight target projects, or create new projects.  When using the Object Mapper, it will also automatically link the generated designer.cs file in the Silverlight target project, and ensure that the namespace and assembly names are in sync.  It's really not a good idea to move the designer.cs file on your own, since both the Object Mapper and the BuildWatcher (code which runs during builds) are specifically looking for the ibedmx file.
 
Re the probing error - the domain model (the generated designer.cs file) must reside in both a non-Silverlight project (a class library or the web project) and a Silverlight project (an SL class library or the Silverlight application), and is automatically added as a linked file in the SL project by the Object Mapper.  In the Prism Explorer, you see the generated model in the ModelExplorer.ModelDF project, and the linked code in the ModelExplorer.ModelDF.SL project.  Note that these class libraries both use an assembly name of ModelExplorer.Model.  Take a look at the app.config in the PrismExplorer.Shell project, and the web.config in the PrismExplorerWeb project, for correct setup of the <probeAssemblyNames>.
 
We have a number of simpler, non-Prism, examples in the Learning Resources folder installed with the product.   The "Four Simple Steps" tutorial is a good place to start.
 
 
Back to Top
jmcfet View Drop Down
Newbie
Newbie


Joined: 10-Oct-2009
Posts: 5
Post Options Post Options   Quote jmcfet Quote  Post ReplyReply Direct Link To This Post Posted: 14-Oct-2009 at 1:53pm
more details:
devforce was probing for a license to I change the web.config to

<probeAssemblyName name="ModelsDevForce.SL" />

and moved the designer.cs file to the ModelsDevForce.SL and now I can create the

_manager = new DomainModelEntityManager(false);

in my dataaccess project but now when I make a call to get some entities like the following:

_manager.ExecuteQueryAsync(_manager.Supplier, GotEmployees, null);

I get the following exception:
The remote server returned an error: NotFound.. If the service is available, then also make sure that the endpoint bindings match between client and server.
This looks like a WCF issue but where is the config info suppossed to be placed.
 
Ward's example is very cool but I am looking for a more basic solution to get started as I do not need offline mode to work.
Back to Top
jmcfet View Drop Down
Newbie
Newbie


Joined: 10-Oct-2009
Posts: 5
Post Options Post Options   Quote jmcfet Quote  Post ReplyReply Direct Link To This Post Posted: 14-Oct-2009 at 12:46pm
I have a prism app I am trying to use Devforce with and want to place the designer.cs file (output of the DevForce object mapper) into its own project. When I moved the file and tried making a call to the service to get enttites I get a serialization issue saying the serialer cannot find EntityModel.I use this approach with Ria data services and works well , I also looked at Ward's wonderful prism example and am not sure why my setup is not working. This also brings up another point , if I regenerate the DomainModel from your tool can I specify a target directory
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down