Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Get Full Path for Project Item...
 

Get Full Path for Project Item...

I am trying to write a reference that specifies (among other things) that an item can only be added to either a very particular folder (i got this part by checking the ProjectItem.Name property) OR any folder contained within it. Im having a hard time getting this second part to work. I tried using the Path.GetFullPath() on the ProjectItem to be able to analyze the string returned to see if I am nested inside my particular folder, but this doesnt seem to work as the Path.GetFullPath() call returns back a path to the debug folder....

probably a simple enough question, but Im sick of fighting with it so please help!

thanks in advance.
smartindale  Thursday, July 27, 2006 4:16 PM
ProjectItem.Properties.Item("FullPath") I believe.
Then you just need to check that the item full path starts with the directory you want to ensure is the parent.
kzu  Friday, July 28, 2006 3:04 PM
If get_FileNames(1) gives you a valid value, then it should be OK.
Note that all DTE collections indexes start at 1 :S
kzu  Monday, August 07, 2006 4:15 AM
ProjectItem.Properties.Item("FullPath") I believe.
Then you just need to check that the item full path starts with the directory you want to ensure is the parent.
kzu  Friday, July 28, 2006 3:04 PM
cool... thank you.


smartindale  Tuesday, August 01, 2006 3:51 AM
Actually, Im sorry... took me a day or two to get around to coming back to put this back in (i was using get_FileNames(0) just to get it working until i got a response).

putting in your code, i get the error that Properties threw a 'NotImplementedException'

please advise.

thanks
smartindale  Tuesday, August 01, 2006 10:15 PM
If get_FileNames(1) gives you a valid value, then it should be OK.
Note that all DTE collections indexes start at 1 :S
kzu  Monday, August 07, 2006 4:15 AM

You can use google to search for other answers

Custom Search

More Threads

• How do you include a folder that has been excluded from a project?
• Fatal Login Error w/ Passport
• Installing Guidance package for both VS2005 and VS2008
• Project reference
• GuidanceAutomationExtensions.msi install error
• Anybody has an idea how to specify a icon file for a recipe. (Please help)
• Update guidance already installed
• One Click
• Add files in multiple projects
• How can I Organize templates in the "new project" dialog?