Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Trying to better understand the CreateProjectAction?
 

Trying to better understand the CreateProjectAction?

After reading the following to posts I have gotten my CreateProjectAction to work. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2859436&SiteID=1

http://207.46.196.83/MSDN/ShowPost.aspx?PostID=2231938&SiteID=1

However, I had to use absolute paths for both the Template location and the ProjectFolder input properties. Is this the expected behaviour or is there a way to provide relative paths to this Properties? I have found a work around to the ProjectFolder location by creating a Custom Value Provider which uses the Solution to determine the root of the project and then appends the necessary folders to create the Project in the appropriate location but I have no idea how to determine the installation location of my guidance package on an individuals computer.

Does anyone have any ideas on how to determine the installation location of a guidance package in a ValueProvider? The installation location is where the Template directory lives and if I could figure out this location I could easily build the absolute path needed by the CreateProjectAction.

I have also looked at the Service Factory. In this factory the projects seems to be created using the ProjectConverter. This however does not use a Template for project creation. If I can not find a way to create the projects using a template in a folder I specify then I could create the projects with the converter and use actions to add each item individually. I have also thought about just using the ProjectTemplateLink to create each project and then in an Action removing them from the solution copying them to the appropriate directory and then adding them back to the solution but I am unsure if this is possible.

Let me know what you all think

pnddgg97  Tuesday, March 04, 2008 5:42 AM

Hi,

Instead of using reflection to get the current running path you have a cheaper option: ask for the IConfigurationService and use its BasePath property. That will return the path to which you will then append @"Templates"...

HTH,
-Victor.
vga  Thursday, March 06, 2008 3:02 AM

Hi,

Whenever you create a new solution using your guidance package, it will use your guidance package dll. You can get the assembly path using reflection. Now, this path is where your guidance package items are installed. From here, you have your folders @"Templates\Solutions\Projects".

You can combine both your assembly path + @"Templates\Solutions\Projects", which will give you the projects path, where your projects reside.

I hope this answers your question.

Regards,

-Noor.

Noor Mohammed  Tuesday, March 04, 2008 10:24 AM

Hi,

Instead of using reflection to get the current running path you have a cheaper option: ask for the IConfigurationService and use its BasePath property. That will return the path to which you will then append @"Templates"...

HTH,
-Victor.
vga  Thursday, March 06, 2008 3:02 AM
This worked very well. Thanks for you help

pnddgg97  Friday, March 07, 2008 2:05 AM

You can use google to search for other answers

Custom Search

More Threads

• Guidance Automation Extensions Registration does not work
• Not able to create a new Guidance Package project
• $(TargetDir) available in Recipe node?
• Guidance Automation Toolkit ( febrruary 2008 ) not able to install
• Application Block Software Factory templates don't appear in VS 2008
• Impossible to uninstall GAT
• Error while displaying the Current Project name in a Text box of a Custom Wizard Page
• Add files in multiple projects
• SOA using WSSF and WCSF
• 2008 New Slippers in www.shoes198.com