views:

56

answers:

1

I seem to have a problem loading .dll files into my silverlight application.

this.pluginDownloader = new WebClient();
this.pluginDownloader.OpenReadCompleted += new OpenReadCompletedEventHandler(pluginDownloader_OpenReadCompleted);
this.pluginDownloader.DownloadProgressChanged += new DownloadProgressChangedEventHandler(pluginDownloader_DownloadProgressChanged);

String path = String.Format("http://localhost/Resources/Plugins/{0}.dll", this.pluginDetails.AssemblyName);
this.pluginDownloader.OpenReadAsync(new Uri(path, UriKind.Relative));

I can manually download the .dll assembly file by navigating to it (eg: http://localhost/Resources/Plugins/myAssembly.dll) but it just stalls the silverlight app when the above code is executed. This works when I launch the project in visual studio so it must be some setting in IIS7.

Anyone know how to fix this?

A: 

Thanks for answering Jeff... I tried relative paths also but that didn't work either. I thought an absolute URL would be the best thing to try as I can actually navigate and download the assembly file using the localhost link.

EDIT: Got it working - if i replace localhost with the actual IP address of the server it works find

String path = String.Format("http://192.168.2.107/code/Platform/Website/Resources/Plugins/{0}.dll", this.pluginDetails.AssemblyName); this.pluginDownloader.OpenReadAsync(new Uri(path, UriKind.Absolute));

I'd still like to know how to get it working using a relative path... The relative path should work - i'm using a one in the same class to load an image

this.pluginImage.Source = new BitmapImage(new Uri("/Resources/Plugins/PluginTile/" + this.pluginDetails.ImageFilename, UriKind.Relative));

Strange...

Eanna