Skip to main content
Home Forums General Silverlight Hosting and Streaming Fetching Controls On Demand not working when deployed on IIS
1 replies. Latest Post by mrjvdveen on June 24, 2009.
(0)
puneetpr...
Member
28 points
17 Posts
06-23-2009 3:33 AM |
Hi Guys,
I am fetching a control "Misys.GreenTrader.UI.Static.dll" on demand from the client bin.
This is the piece of code that i have written to fetch the control and add the GreenTraderConfig() usercontrol in the existing stack panel.
// Fetch the next controlWebClient client = new WebClient();client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);client.OpenReadAsync(new Uri("Misys.GreenTrader.UI.Static.dll", UriKind.Relative));
void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { AssemblyPart assemblyPart = new AssemblyPart(); Assembly asm = assemblyPart.Load(e.Result); LoadGreenTraderConfig(); }
[MethodImpl(MethodImplOptions.NoInlining)] void LoadGreenTraderConfig() { mainPg_Container.Children.Add(new GreenTraderConfig()); }
It works fine with visual studio 2008. But as i deploy it in IIS 6 it does'nt work, its also not throwing any error.
I need an urgent help, as deployment dates are getting closer .
Thanks,
Puneet
mrjvdveen
Participant
1937 points
366 Posts
06-24-2009 2:49 AM |
Have you checked if the file is actually there? Good chance it doesn't even get deployed.
Also I find that this is a risky approach as there very well may be dependencies for this dll that are not loaded. The best way around this would be to package it in a .xap file with it's dependencies and load that.
You can find a blogpost about loading stuff dynamically here and here.
HTH.