Downloader object - Error: AG_E_NETWORK_ERROR
Last post 02-29-2008 7:51 AM by bitman_dk. 7 replies.
Sort Posts:
02-27-2008 6:02 PM
Downloader object - Error: AG_E_NETWORK_ERROR

The very simple code below produces the error 4001 -  AG_E_NETWORK_ERROR, what could the problem be? 

Private Sub SetupMap()

mySpriteLoader =
New Downloader
AddHandler mySpriteLoader.Completed, AddressOf Me.spriteloader_completed
mySpriteLoader.Open(
"Get", New Uri("sprites.zip", UriKind.Relative))
mySpriteLoader.Send()

End Sub

Private Sub spriteloader_completed(ByVal sender As Object, ByVal e As System.EventArgs)

For intCount As Integer = 1 To 3
Dim myImage As New Image
myImage.SetSource(mySpriteLoader, intCount.ToString &
".png")
myImage.SetValue(Canvas.LeftProperty, intCount * 48)
Next

End Sub

bitman_dk

Loading...
Joined on 02-25-2008
Posts 6
02-27-2008 6:20 PM
Re: Downloader object - Error: AG_E_NETWORK_ERROR

Are you accessing this from a web server or file based testing? You can only use the downloader from the web server as far as I know.

 
Fred Hirschfeld
(If this answers your question please select "Mark as Answered")

FredHirschfeld

Loading...
Joined on 02-03-2008
Tacoma
Posts 158
02-28-2008 6:02 AM
Re: Downloader object - Error: AG_E_NETWORK_ERROR

It's created as a "Silverlight project" in VS2008 (vb.net).

The "allmost same code" is used in the Digger game (from the community galler: 2.0 gallery: 
 Digger) - i downloaded that project - at here it works well - and to my knowledge
the digger game does not run from IIS.

But when i try the same code in Vb.net I get the network error - strange?

bitman_dk

Loading...
Joined on 02-25-2008
Posts 6
02-28-2008 5:23 PM
Re: Downloader object - Error: AG_E_NETWORK_ERROR

I added an eventhandler for donwloadfailed - and when that event happens  - i get the following from the downloader object:

Status: 204
StatusProperty: {System.Windows.DependencyProperty}
StatusText: "NO CONTENT"

bitman_dk

Loading...
Joined on 02-25-2008
Posts 6
02-28-2008 5:53 PM
Re: Downloader object - Error: AG_E_NETWORK_ERROR

Tried to build the same code in a new C# project - and still get the same error.
The "funny" thing is that these lines of code is copy/paste from the "Digger" community sample - where it works:
this.spriteDownloader = new Downloader();
this.spriteDownloader.Completed += new EventHandler(this.SpritesDownloader_Completed);
this.spriteDownloader.Open("Get", new Uri("Sprites.zip", UriKind.Relative));
this.spriteDownloader.Send();

Only difference between above code and Digger sample -is that the newly created project has target framweok 3.5 - where the digger sample (which works) has target framework 2.0 - could that make a difference. And if that's the problem how is the downloader object supposed to work under 3.5?

bitman_dk

Loading...
Joined on 02-25-2008
Posts 6
02-28-2008 6:27 PM
Re: Downloader object - Error: AG_E_NETWORK_ERROR

You must be using some sort or web server (maybe the cassini built in one) as you run the web project. How do you have your solution setup?

Silverlight Project

ASP.NET Web Project (with the linked silverlight project)

And are your assets (Sprites.zip) contained in Silverlight or ASP.NET Web project? If in Silverlight you will need to be sure to tag the file as Content so it is copied to the Web project.

 
Fred Hirschfeld
(If this answers your question please select "Mark as Answered")

FredHirschfeld

Loading...
Joined on 02-03-2008
Tacoma
Posts 158
02-29-2008 4:16 AM
something is wrong !

Geeked I executed the objecte downloader with both js code behind and cs code behind with filesystem not iis .the js has no problem and i think that this one dosenot have any problem that the program isn't in the sever but the problem is some where else...

 

Navid

Joined on 02-11-2008
Iran
Posts 1
02-29-2008 7:51 AM
Re: something is wrong !

Hi Navid - you write that ".js code has no problem" - what about your C# test?

I run my vs2008 on a windows2003 server - standard edition.

I also changed "build action" for sprites.zip to "content" and replaced the file to download  to be a .png file instead og .zip file - still (both in c# and vb.net) - I get an "AG_E_UNKNOWN_ERROR".

 

Really strange.

 

bitman_dk

Loading...
Joined on 02-25-2008
Posts 6
Page view counter