views:

55

answers:

2

My application works great in debug mode but crashes after deplying it on localhost (for testing purposes)

And the error message indicates that the path is invalid... And the first thing i don't get is why the directory is invalid.. I read it with:

Application.StartupPath & "\Images\"

C:\Documents and Settings\george\Local Settings\Apps\2.0\TRWYPDB1.7AD\JV28ARZ2.0NT\web..tion_864dd297f96a940b_0001.0000_f9d0072f76933330\Images

So in which directory of windows (ANY VERSION) it is the best practice to download and extract a zip file, containing images? The images will be used in each time my application starts.

C:\Documents and Settings\george\Local Settings\Temp

C:\Temp

or what?

+2  A: 

You'll always want to use System.IO.Path.GetTempPath in .NET. Who's to say what version of Windows your user is running, let alone if it's even English? Let the API take care of finding the temporary directory.

Mark Rushakoff
A: 

Is the zip file actually in the \Images folder? I'm assuming you're checking to make sure you don't have any extra slashes or something funkyk like that.

If you deploy the zip file with the application, you should be able to unzip it and access the images there. This is not out of line, since the files are part of the deployment, and you are going to repeatedly use the files.

However, if you want to create a cache that won't be lost when the ClickOnce application gets updated, the recommended location is LocalApplicationData. This blog post explains this: Where do I put my data to keep it safe from ClickOnce updates?

RobinDotNet