Home All Groups Group Topic Archive Search About

how to avoid broken references when give out projects

Author
22 Mar 2006 10:48 PM
Tanja Krammer
Dear all,
is it possible to add reference with a relative path instead of absolute?
Thanks,

Author
23 Mar 2006 12:29 AM
I Don't Like Spam
Tanja Krammer wrote:
> Dear all,
> is it possible to add reference with a relative path instead of absolute?
> Thanks,
>
>

Yes...

Of course I could be more helpful if you described how you were using
the path in question.

If you just need to know the directory where the executable was launched
from then use Application.StartupPath

Chris
Author
23 Mar 2006 3:31 AM
Hal Rosser
"Tanja Krammer" <tanja_kram***@delay.nop> wrote in message
news:uPKYLLgTGHA.4452@TK2MSFTNGP12.phx.gbl...
> Dear all,
> is it possible to add reference with a relative path instead of absolute?
> Thanks,
>

Yes, but keep in mind the reference path needs to be in reference to the exe
file - not the source code - so you're starting in the bin folder.
FOr instance, if you access an image in the same folder as the exe you can
use "./imagename.jpg" - or leave off the "./" if you want .
Author
23 Mar 2006 12:26 PM
Tanja Krammer
But how you do that? When you press "Add Reference" button you have no field
to type something, you only can browse. Do you edit project file directly?
Show quoteHide quote
"Hal Rosser" <hmros***@bellsouth.net> schrieb im Newsbeitrag
news:0BoUf.610$q6.185@bignews8.bellsouth.net...
>
> "Tanja Krammer" <tanja_kram***@delay.nop> wrote in message
> news:uPKYLLgTGHA.4452@TK2MSFTNGP12.phx.gbl...
>> Dear all,
>> is it possible to add reference with a relative path instead of absolute?
>> Thanks,
>>
>
> Yes, but keep in mind the reference path needs to be in reference to the
> exe
> file - not the source code - so you're starting in the bin folder.
> FOr instance, if you access an image in the same folder as the exe you can
> use "./imagename.jpg" - or leave off the "./" if you want .
>
>
Author
23 Mar 2006 2:47 PM
Herfried K. Wagner [MVP]
"Tanja Krammer" <tanja_kram***@delay.nop> schrieb:
> is it possible to add reference with a relative path instead of absolute?

Check out the contents of the VB.NET project file in notepad.  It will
contain a relative path and an absolute "hint path" for references, which
helps VS.NET to quickly locate the DLL when the project is opened.  However,
the compiled application should be able to find the DLL if it's contained in
the application's directory.

BTW:  There is a German VB.NET group available
("microsoft.public.de.german.entwickler.dotnet.vb").

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
23 Mar 2006 3:31 PM
Armin Zingler
"Tanja Krammer" <tanja_kram***@delay.nop> schrieb
> Dear all,
> is it possible to add reference with a relative path instead of
> absolute? Thanks,


This might be of interest:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp


Armin