Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi i need to give a relative path for the folder in the solution
thsiis the complete path:c:\users\priya.sasidharan\documents\visual studio 2010\Projects\ProjectAddIn3\ProjectAddIn3\Templates\Data.xml
I gave like this@"~\Templates\Data.xml but its not wrking.it is showing the following error
'C:\Users\priya.sasidharan\Documents\~\ProjectAddIn3\ProjectAddIn3\Templates\Data.xml' could not be found
Posted 20-Feb-13 20:53pm
Edited 20-Feb-13 21:20pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello Spriyanair,
 
Relative path enforces that you know (in the code on runtime) where are you executing from.
During runtime, a relative path will be concatenated with the path of the executable running.
 
For example using relative path in visual studio will act differently when running in debug mode or in release mode since they operate from different folders.
 
From your question is seems that your executable is in the folder: C:\Users\priya.sasidharan.AMEX\Documents\
is that the relative path you want your @"~\Templates\Data.xml" to be added to?
 
Cheers,
Edo
  Permalink  
Comments
spriyanair at 21-Feb-13 2:18am
   
I want this relative path c:\users\priya.sasidharan\documents\visual studio 2010\Projects\
 
but after documents iam not getting the path
Azziet at 21-Feb-13 2:28am
   
remove space in visual studio 2010 folder name
spriyanair at 21-Feb-13 7:32am
   
NOT WRKING

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 565
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100