AG_E_NETWORK_ERROR in SIlverlight

霸气de小男生 提交于 2019-12-24 10:06:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!