How do you replace visual studio template variables in razor cshtml pages?
I have a custom visual studio 2010 mvc3 project that we use in our shop for new projects. When replacing namespaces with the actual project name, everything works great until I get to my .csh开发者_如何学运维tml pages. Is there a way to force the template engine to pass the variables in to the page?
I have something like the following:
<title>@$safeprojectname$.Constants.applicationName</title>
Is there a way I can set this up such that someone starting a new project doesn't have to replace any text?
Go into your project template's vstemplate file and make sure that every ProjectItem
entry that uses parameters has the ReplaceParameters="true"
attribute set.
精彩评论