问题
I have few directories in my IIS server (physical location inetpub\wwwroot\SampleApp)
The directories contain .jpeg images. I am iterating these images in C# from Silverlight.
And this is how I assign the image on the server to my Image placeholder in SL
BitmapImage bi = new BitmapImage();
bi.UriSource = new Uri(url + sharedLink + currentSlide + ".jpg");
PresentationImage.Source = bi;
where PresentationImage is the container for Images.
Now, when I can access some of the directories and iterate through the images however for some of the directories I am getting this error Failed to open System.Exception: AG_E_NETWORK_ERROR
I couldn't find any helpful links on GOOGLE either. I cannot get a hang of this error.
Can anyone please give me a lead into whats happening?
回答1:
I got this error and saw the above link which also didn't work. Turned out the path to my .xap file was incorrect in my webpage. Instead of "/MyApp.xap" I needed "MyApp.xap" because of the way I had deployed it. "File does not exist" as an error description would have made a lot more sense!
Suggest checking exactly what filepath is being generated at runtime.
回答2:
I had the exact same error and everything was OK but images wont load and than I changed the default start up project from the silverlight control to the .web
project and it started working I don't know why but it solved my problem.
来源:https://stackoverflow.com/questions/4624816/ag-e-network-error-in-silverlight