Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug ImageError error #4001 in control 'ctl00_Main_Silverlight2'
5 replies. Latest Post by ekleeman on December 28, 2008.
(0)
ekleeman
Member
59 points
42 Posts
12-26-2008 6:07 PM |
This error only occurs when using Slide.Show2 or PageTurn2 from my web server. Other Silverlight apps I have work perfectly.
Who knows what the problem is? Both apps work perfectly on the local VS webserver so it must be a Silverlight BUG.
BTW, I do not have two images the same name and the images are under the XAP file location.
swildermuth
Star
8320 points
1,546 Posts
12-27-2008 5:17 PM |
This error is thrown when it can't find the image so how you're hosting it is probably hitting you that relative URI's are being mapped differently on your server. Its likely a "site of origin" uri issue:
http://wildermuth.com/2008/06/23/Silverlight_s_XAML_Relative_URI_s_and_Site_of_Origin
BTW, this error is not trappable in .NET, you have to trap it via the OnError handler of the control itself (silly, yes, but the fact right now).
12-27-2008 6:48 PM |
My path is the same in reference from the xap file locally and on my web server. The xap is in root/Public/ the images are in root/Public/Gallery/*
This works perfectly locally with the development web server in VS. Just as an experiment I tried putting the images in the same path as the xap file and even included the images in the xap file and still had the same error.
12-27-2008 9:11 PM |
So locally its something like: http://localhost:8888/root/Public/Gallery/*.png and on the server its: http://mydomain/root/Public/Gallery/*.png If you are using a Website not a webapplication then the URI's will be different on teh server. Perhaps you could share what the full URI's (including fake server names if necessary).
12-27-2008 9:13 PM |
Also, it could be that the IIS server is failing to give access to those images for other reasons (the image extensions are mapped as MIME types, security of the folder isn't available). Can you navigate to the images manually on teh server? If not, its an IIS setup issue, not Silverlight.
12-28-2008 12:24 AM |
Actually the 2 apps I'm trying to implement use the same technique,
ImageElement.Source =
Where Source is supposed to be a relative Uri based on a string like Gallery/KohTao/KohTao1.jpg, which works locally but not on my dedicated server
I've heard everything from filename duplicates, path non existent, or latentcy that causes WebClient.DownloadAsync to return a false positive.
On the same web site I have my own Silverlight app that loads XAML code programatically for example:
panel12img1Xaml +=
The XAP for this is in a subfolder with the same permissions as the other subfolder that fails to load images using a Uri.
At this point I'm shelving the Silverlight Slide.Show2 and Pageturn2 Gallery apps until this issue is resolved by the developers or MS. I could probably fix it but I have other things I'd rather be working on.
Thanks anyway.... Se La Vie
BTW, this Slide.Show Gallery worked fine under Silverlight 1.2 but not Silverlight 2.0 but I don't want to require my visitors to download an old version of a plugin.