PC Review


Reply
Thread Tools Rate Thread

Assembly reference as a relative path?

 
 
Richard
Guest
Posts: n/a
 
      29th Oct 2004
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.
 
Reply With Quote
 
 
 
 
SP
Guest
Posts: n/a
 
      31st Oct 2004
"Richard" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      1st Nov 2004
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:%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
SP
Guest
Posts: n/a
 
      2nd Nov 2004
"Richard" <(E-Mail Removed)> wrote in message
news:ung2$(E-Mail Removed)...
>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


 
Reply With Quote
 
Richard
Guest
Posts: n/a
 
      2nd Nov 2004
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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't bind to an assembly using relative path Toma Catalin Microsoft Dot NET Framework 0 14th Jul 2008 09:57 AM
Load an assembly using a relative path timnels@gmail.com Microsoft C# .NET 3 11th May 2007 06:55 PM
Narration - Relative Path Reference =?Utf-8?B?THlubg==?= Microsoft Powerpoint 2 8th Jan 2005 02:56 AM
why relative hint path but absolute reference path gerry Microsoft Dot NET Framework 1 23rd Sep 2004 09:44 AM
Use of relative path in assembly info???? serge calderara Microsoft Dot NET 1 24th Jul 2003 02:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.