New Posts New Posts RSS Feed: Error in model generation (code first)
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Error in model generation (code first)

 Post Reply Post Reply Page  <12
Author
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Topic: Error in model generation (code first)
    Posted: 25-Sep-2012 at 2:04pm
I didn't say the 3 models where dynamically loaded in différents xap and not the Security model.
If I set a reference to those model on the appplication it works.

Looks like there is a recomposition issue. Maybe something is broken on my part with the mix of yield return and Task.

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: 25-Sep-2012 at 4:50pm
I'm afraid we'll need Marcel's help with this, since I'm not familiar with Cocktail. 
 
We did make composition-related changes in both DevForce and Cocktail in the 2012 beta release, but based on this error I don't know whether the problem is there, or in the XapLoader I see in the sample you sent.  Until DevForce has fired the Recomposed event the newly loaded entity types won't be available, and the lack of metadata for these entities could cause an EntityManager constructor to fail.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 25-Sep-2012 at 5:00pm
I wasn't sure if it was in the XAPLoader too so I did rewrite it without yield return.

Same problem.

I then tried to directly use the AddXapAsync method from cocktail and same problem. Below the code I use.
The ActivateWorkspaceAsync method instantiate the view and navigate to it thru Cocktail Navigator service.

ExecuteAsync() is bind to the click event of a button.

        public async overide Task ExecuteAsync()
        {
            try
            {
               await Composition.AddXapAsync("xxx.Commun.Screens.xap");
               await ActivateWorkspaceAsync("xxx.Commun.Screens.ViewModels.News.NewsWorkspaceViewModel, xxx.Commun.Screens, Version=1.0.0.0");
            }
            catch (Exception e)
            {
               ErrorFns.HandleError(e);
            }
        }

Maybe super marcel will come to the rescue ...


Do you plan to provide new beta builds of devforce regulary thru nuget ?

Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 25-Sep-2012 at 11:05pm
Walid,
The error message about the missing constructor is missleading here. What's actually going on is that the EntityManager fails to instantiate. I can tell that from the following error:
 
Unable to get metadata for xxx.Commun.Domain.Entities.News. Make sure it is a valid entity type or POCO type with a KeyAttribute
 
What does the inner exception say?
 
I see these errors primarly if PostSharp didn't do it's job, but maybe in this case it has something to do with the xap loading. I did test xap loading, but I don't remember if I tested it with a CF domain model in the dynamic xap. I have to put together a small repro and see If I get any issues.
 
Sorry, you are having these issues. We appreciate you attempting this migration. With a beta product there are bound to be issues.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 26-Sep-2012 at 5:05am
The inner execption is null

The thing is if it was a recomposition issue I should be able to use the model, few second after the error, once the recomposition is done  right ? because if I navigate to another screen which use the same model I will still get the same error, not matter how long I wait before to navigate.
That would means the error is more certainly because of Postsharp.

But, if I reference the same model in the silverlight Application it works so I am confused to what is the real cause.


Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down