Print Page | Close Window

Dynamic loading Domain assembly

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4128
Printed Date: 27-May-2024 at 5:49pm


Topic: Dynamic loading Domain assembly
Posted By: rehmanmansoor
Subject: Dynamic loading Domain assembly
Date Posted: 25-Apr-2013 at 6:48pm
HI ,

I have Domain Entities reference in the Silverlight Class Library. And im using that SL Library in our SL Application.

So to reduce the XAP file i need to download my Silverlight Class Library on demand when the Xap file is downloaded and ready to use.

I have used WebClient class to download and load my SL Class Library in to my silverlight application domain.
But im getting an error that is

"Unable to get metadata for Project1.Data.Entities.BaseDomainModelEntity. Make sure it is a valid entity type or POCO type with a KeyAttribute"

BaseDomainModelEntity.cs is the base class for all the Entities

Pls guide me how to work out in this scenario

I have also look into this article http://drc.ideablade.com/xwiki/bin/view/Documentation/on-demand-discovery
But correct me if im wrong this on-demand-discovery in only used to download modules in new XAP file ? As i need to download Silverlight Class Library not SL Application.

Thanks in Advance.
RM



Replies:
Posted By: kimj
Date Posted: 26-Apr-2013 at 9:25am
The DynamicXap is most frequently used in SL apps with DevForce, since it wraps both the WebClient download and the recomposition necessary for DF to recognize the new content.

If you wish to download a DLL only you can still do this. After downloading and loading the assembly, wrap it in a MEF AssemblyCatalog, and pass this to the DF CompositionHost:

Assembly asm = ...
var catalog = new AssemblyCatalog(asm);
IdeaBlade.Core.Composition.CompositionHost.Add(catalog);



Print Page | Close Window