why relative hint path but absolute reference path

Visual Studio .Net

    Next

  • 1. Collapse to Definitions on Open?
    I finally got back to this issue, and here is what I did: Record a one-line macro that makes a call to CollapseToDefinitions (select the item on the Edit Menu). Then create a DocumentEvents_DocumentOpened event handler in the Macro IDE (go to Macro Explorer, open the macro IDE, and select the Environment Events module in My Macros). Create a DocumentEvents_DocumentOpened handler and move the recorded call to CollapseToDefinitions to the event handler. Documents will now collapse to Definitions when they are opened.
  • 2. Determine if running in Visual Studion IDE
    How do you determine if a program is running in the Visual Studio IDE/debugger as opposed to standalone? We often include support files in the same folder as the executable and would so something like: Dim SupportFile As String SupportFile = Application.StartupPath & "\SupportFile.txt" But of course this fails when running in the IDE as the executable is in the BIN folder so we need to do something like this: Readonly Property SupportFilesPath() As String Get If IsIde() Then SupportFilesPath = Application.StartupPath & "..\" Else SupportFilesPath = Application.StartupPath & "\" End If End Get End Property Need to implement that IsIde() function/property... Thanks, Rob.
  • 3. XML Comments - How to use
    Sometime back, I found two ways to use the results of XML Comments in the C# code. One way was to set the file in the project properties and it produced a less than useful output without doing more work. The other way produced HTML documentation with one 'item' per HTML page. I can't find the reference on how to get VS to generate that again. Can someone tell me host to get the HTML documentation created or point to the doc again? Thanks ------------------------------------------- Roy Chastain KMSystems, Inc.
  • 4. creating an addin that can be run independently
    Hi, Is it possible to create an addin that can also be run independently. An addin creates a dll while to run independently I need an exe. Thanks amit
  • 5. An unhandled exception has been caught by the VSW exception filter.
    I just installed VS.Net but when I try to open any of the solution (.sln) files. I get a crash and dump with the following message "An unhandled exception has been caught by the VSW exception filter." I have sifted through numerous messages in the newsgroups with no luck on how to investigate or solve this problem. Any ideas, suggestions are welcome. Ola

why relative hint path but absolute reference path

Postby gerry » Thu, 23 Sep 2004 23:12:16 GMT

I have a vs.net 2002 solution that contains a number of projects
All projects are created in folders under the solution folder.
The idea here is that this entire solution should be 'moveable' ie. copied
to and useable from a new directory or computer.
And it almost is.

One project makes reference to an existing .net dll that also exists in a
folder under the solution folder.
The project file shows a relative hint path to the dll ie
"..\..\dllFolder\my.dll"
If I move the solution to a new folder and the open solution from the new
location, the dll can no longer be found.  if i restore the original
solution folder, the dll is once again found.  so obviously, although the
project file includes a relative hint path, vs.net is in fact looking for
the dll at an absolute location.  This is causing headaches as this solution
cannot be 'passed around'  without re-adding the reference to this dll.

is there some setting somewhere to get the relative path used ?
there does not seem to be any problem using relative project references - is
there some trick using a dummy project to get this to work ?

gerry







RE: why relative hint path but absolute reference path

Postby v-garych » Fri, 24 Sep 2004 15:55:19 GMT

Hi gerry,

is there some trick using a dummy project to get this to work ?

How do you reference that existing .net dll in your project, by wizard?
If so, the wizard appears to use an absolute path to locate the .NET 
assembly.

For using a project, I think if you have that .net dll's project, you can 
copy that project directory into your solution directory and add that 
project to your current solution, then reference the project... 


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


Re: why relative hint path but absolute reference path

Postby gerry » Sat, 25 Sep 2004 02:31:16 GMT

Hi Gary ,
thanks for the reply
i add the reference by right clicking the project in solution explorer and
selecting add reference and then browse to the dll.
there is no project for this particular dll, it is generated manually using
jbimp.







references -
rights.



Re: why relative hint path but absolute reference path

Postby v-garych » Sat, 25 Sep 2004 15:48:53 GMT

Hi gerry,

and selecting add reference and then browse to the dll.
using jbimp.

Since you don't have the .NET dll's generic project, using a project 
reference appears to be impossible...


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


Re: why relative hint path but absolute reference path

Postby v-garych » Tue, 28 Sep 2004 11:08:07 GMT

Hi gerry,

Would you please give us an update of this issue?
If you have any more concerns on it, please feel free to post here.


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


Re: why relative hint path but absolute reference path

Postby gerry » Wed, 29 Sep 2004 08:32:09 GMT

basically , we are forced to re-add the dll reference when the solution is
moved/copied/passed around.








rights.



Re: why relative hint path but absolute reference path

Postby v-garych » Thu, 30 Sep 2004 18:00:34 GMT

Thanks for your response, gerry,


.. it appears the only workaround under this scenario.


Good Luck!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


Re: why relative hint path but absolute reference path

Postby v-garych » Fri, 01 Oct 2004 17:57:17 GMT

Hi gerry,

Additionaly, the project's reference file should use the absolute path such 
as:
 <References>
                <Reference
                    Name = "System"
                    AssemblyName = "System"
                    HintPath 
="C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
                />
..

And the project include files would use the relative path to locate:
<Files>
            <Include>
                <File
                    RelPath = "App.ico"
                    BuildAction = "Content"
                />
..

So do you make sure the referenced DLL file use a relative path in the 
.csproj file?


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------


Re: why relative hint path but absolute reference path

Postby gerry » Fri, 01 Oct 2004 23:58:29 GMT

Hi Gary ,

VS.NET is creating all paths in the project file as relative , including the
references.

the .csproj.user does contain absolute paths in ReferencePath - I suppose if
we don't distribute this file then new references would only have to be
added once per machine rather than after every update.

gerry






such
rights.



Re: why relative hint path but absolute reference path

Postby yhhuang » Wed, 06 Oct 2004 16:02:18 GMT

Hi Gerry,

When you need to use a type (such as a class or structure) contained in 
another assembly, you must set a reference to that assembly. This creates 
an assembly reference within the client assembly's manifest that identifies 
the name and version of the dependency. Visual Studio .NET supports two 
types of references: project references and file references.

The Projects page within the Visual Studio .NET Add Reference dialog box 
lists all of the other projects in the current solution. This allows you to 
create a project reference to another project in the same solution. Project 
references are the recommended way to set references because they offer 
many advantages.
(Note   Project references are the main reason you should adopt a single 
solution or partitioned single solution model wherever possible.)

If you can't use a project reference because you need to reference an 
assembly outside of your current solution's project set, you must set a 
file reference. The following are the two ways to set a file reference: 

To reference a .NET Framework assembly, you select the assembly from the 
list displayed on the .NET tab of the Add References dialog box. 
You can use the Browse button in the Add Reference dialog box. 
If you set a file reference, the path to the assembly is stored in the 
source controlled project file. A relative path is stored for local 
assemblies, while the full network path is stored for server-based 
assemblies, as 

For your scenario, there may be some solutions. Please refer to the 
following link for all existing good ways:
 http://www.**--****.com/ 
tdlg_ch4.asp
The information in this link helps you: 
Manage dependencies and references between projects and solutions. 
Work with dependencies on .NET assemblies, Web services, databases, 
serviced components, and COM Interop libraries. 

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure!  www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
- http://www.**--****.com/ 
p&SD=msdn 

This posting is provided "AS IS" with no warranties, and confers no rights.


Re: why relative hint path but absolute reference path

Postby yhhuang » Fri, 08 Oct 2004 10:29:41 GMT

Hi Gerry,

Do you have any more concerns on this issue? If there is any unclear on the 
materials that I posted, please feel free to reply here. We are closely 
monitoring the issue thread.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure!  www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
- http://www.**--****.com/ 
p&SD=msdn 

This posting is provided "AS IS" with no warranties, and confers no rights.


Similar Threads:

1.why relative hint path but absolute reference path

I have a vs.net 2002 solution that contains a number of projects
All projects are created in folders under the solution folder.
The idea here is that this entire solution should be 'moveable' ie. copied
to and useable from a new directory or computer.
And it almost is.

One project makes reference to an existing .net dll that also exists in a
folder under the solution folder.
The project file shows a relative hint path to the dll ie
"..\..\dllFolder\my.dll"
If I move the solution to a new folder and the open solution from the new
location, the dll can no longer be found.  if i restore the original
solution folder, the dll is once again found.  so obviously, although the
project file includes a relative hint path, vs.net is in fact looking for
the dll at an absolute location.  This is causing headaches as this solution
cannot be 'passed around'  without re-adding the reference to this dll.

is there some setting somewhere to get the relative path used ?
there does not seem to be any problem using relative project references - is
there some trick using a dummy project to get this to work ?

gerry



2.Get machine name path from relative or absolute path

Hello, is it possible in C#.Net to get a path to a file in the form
"\\Spain\Madrid\readme.txt" from a relative path i.e "readme.txt" or
from a absolute path in the following form "C:\Madrid\readme.txt" where
"Spain" is the name of the machine that the file is on? Thanks in
advance.

3.absolute path to relative path conversion

4.Absolute or Relative path?

5.Relative & absolute path question (JavaScript, mostly)

6. User controls --> Relative/Absolute Paths

7. Absolute url from relative path

8. Absolute and relative paths in applicaiton



Return to Visual Studio .Net

 

Who is online

Users browsing this forum: No registered users and 2 guest