Relative paths break after install

G

Guest

Sorry about the cross posting to this group but I posted this question for a
coworker last week in the setup board and got no help:


hi,

If my project has subfolders and I have relative paths into those folders
(for images, xml files, etc.), after installing the application on the target
machine, the relative paths are different and nothing works.

This is because during development, the .exe is located in
appFolder/bin/Debug but after install, it is located in appFolder (the
deployment wizard puts it there by default). During development, a path of
"..\..\images" works fine, but after install it should be "\images". What is
the proper .NET way of handling this sort of thing?

I can't seem to change the location where the exectuable is located without
also changing where the subfolders go so that doesn't seem to be the solution.

Any help would be greatly appreciated.
 
G

Guest

I would change the output directory of your project to not be bin/debug but
be some top level directory like MyProjectDirectory, then under this
directory you can copy your image directory.

When you install the product, you images should still be in the correct
relative location because you were no longer building to bin/debug during
development but to the same directory structure (not necessarily the same top
level directory) but the overall directory structure is the same during
development and deployment..

Hope that helps
Mark R Dawson
 
C

Christof Nordiek

Seamse to be a good idea; does anyone know about problems arising from that?

Christof.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top