By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,217 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,217 IT Pros & Developers. It's quick & easy.

Assembly reference as a relative path?

P: n/a
We are distributing a VS2003 solution to our customers that
includes a .NET assembly (dll file) and a sample project for
how to use the dll. The customer can then customize the sample
or add a new project to the solution.

The problem is that the customers cannot simply take the
solution we distribute and build it. VS2003 is saving the
reference to the dll as an fully qualified absolute path
(not relative to the project), so after installing the
solution, each customer has to first manually add in the
dll reference to where it was installed on their computer.
Is there any way around this? It is possible to initially
enter a relative path but VS saves it as an absolute path.
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
SP
"Richard" <rk********@hotmail.com> wrote in message
news:8b**************************@posting.google.c om...
We are distributing a VS2003 solution to our customers that
includes a .NET assembly (dll file) and a sample project for
how to use the dll. The customer can then customize the sample
or add a new project to the solution.

The problem is that the customers cannot simply take the
solution we distribute and build it. VS2003 is saving the
reference to the dll as an fully qualified absolute path
(not relative to the project), so after installing the
solution, each customer has to first manually add in the
dll reference to where it was installed on their computer.
Is there any way around this? It is possible to initially
enter a relative path but VS saves it as an absolute path.


If you look in a project file in notepad or an XML editor it appears that
references to a DLL are saved with relative path using the HintPath tag.
When you look at the properties on a referenced DLL the Path shown is
absolute but it would seem that VS is just resolving the HintPath to an
actual path. Assuming you have a bin directory and a samples directory
within your install directory (which can be changed by the person installing
the software), make sure the DLL is within the hierarchy of your installtion
directory so the HintPath will be something like "..\..\bin\MyDll.dll". i.e.
up to the Samples directory, up to the install directory, down to the bin
directory.

HTH

SP
Nov 16 '05 #2

P: n/a
I looked in the project file and there are no HintPath tags at all
(including none for the .NET Framework dll references). I inserted
a HintPath tag for my dll reference and Visual Studio still reports
it as missing when I load the project.

I happen to be building for Pocket PC platform, though I don't think
it should make any difference.

- Richard

"SP" <egatsecneserp(reverse)@hotmail.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
If you look in a project file in notepad or an XML editor it appears that
references to a DLL are saved with relative path using the HintPath tag.
When you look at the properties on a referenced DLL the Path shown is
absolute but it would seem that VS is just resolving the HintPath to an
actual path. Assuming you have a bin directory and a samples directory
within your install directory (which can be changed by the person installing
the software), make sure the DLL is within the hierarchy of your installtion
directory so the HintPath will be something like "..\..\bin\MyDll.dll". i.e.
up to the Samples directory, up to the install directory, down to the bin
directory.

HTH

SP

Nov 16 '05 #3

P: n/a
SP
"Richard" <rk********@hotmail.com> wrote in message
news:un**************@TK2MSFTNGP14.phx.gbl...
I looked in the project file and there are no HintPath tags at all
(including none for the .NET Framework dll references). I inserted
a HintPath tag for my dll reference and Visual Studio still reports
it as missing when I load the project.

I happen to be building for Pocket PC platform, though I don't think
it should make any difference.


PocketPC project does use a different layout. I did the following and it
worked fine for me. I created a PocketPC project. I copied a DLL into the
project root folder. I added a reference to this DLL. I closed the project
and moved the project folder to a different location (and also renamed the
folder). I opened the project without any problem.

SP
Nov 16 '05 #4

P: n/a
Thanks, it worked for me also. I found that ReferencePath in the project file
is normally set to the full absolute path, except if the reference is in the
root then it is set to null. The lack of relative path is a clear deficiency
in Visual Studio and I guess this is the best I can do for now. The DLL in my
case is supposed to be a common file that can be referenced by multiple
projects. To distribute a solution that works out of the box would mean
adding a redundant copy of the DLL to each project.

- Richard
PocketPC project does use a different layout. I did the following and it
worked fine for me. I created a PocketPC project. I copied a DLL into the
project root folder. I added a reference to this DLL. I closed the project
and moved the project folder to a different location (and also renamed the
folder). I opened the project without any problem.

SP

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.