Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2008 custom class item template, $safeprojectname$ not reconciling

Just setting up some quick class and object item templates and all is working great so far, but one thing I'm stuck on is the $safeprojectname$ template parameter.

I've added this as part of the namespace portion and the $registeredorganization$ is working fine

namespace $registeredorganization$.$safeprojectname$
{
    public class $safeitemname$
    {
        public $safeitemname$() 
        {
            //default constructor
        }
    }   
}

And I've gone into the .vstemplate file and made sure ReplaceParameters="true" so the only thing I guessed at this point is the period between the company and project name, so I tested this out and just for laughs removed the period, still no go. Anyone have any insight as to why this isn't working?

EDIT: I'll accept Jared's answer as it answers my core question "why isn't it working?" but I am adding this follow up to show how I got my desired result. Instead of using the $safeprojectname$ or $projectname$ I found that using $rootnamespace$

namespace $registeredorganization$.$rootnamespace$

or depending on how your project is named:

namespace $rootnamespace$

works as I had wanted, just added this for anyone else who may come across this issue.

like image 630
curtisk Avatar asked Feb 03 '10 14:02

curtisk


1 Answers

The $safeprojectname$ template replacement macro is only available from the New Project Dialog. It will not work for anything added as in individual item.

Reference: http://msdn.microsoft.com/en-us/library/eehb4faa(VS.80).aspx

like image 139
JaredPar Avatar answered Oct 13 '22 19:10

JaredPar