Replacing string literal values in Visual Studio project templates
- by Daniel A. White
I notice when I create a project template from an existing project in my solution, it does a semi-string replace to update references. However, it does not replace string literals. It does update my web.config file, but not code files.
The project template:
namespace MyTemplateProject
{
class MyClass {
public string GetStringValue() { return "MyProjectTemplate"; }
}
}
The generated code when used as a template:
namespace MyActualNewProject
{
class MyClass {
public string GetStringValue() { return "MyProjectTemplate"; }
}
}
How can I instruct the template maker to replace "MyProjectTemplate" wih "MyActualNewProject"?