我正在尝试创建类似于MVC的Area的ItemTemplate。无论如何,我无法在TemplateContent中创建一个包含TargetFolderName和参数的文件夹。这是我的TemplateContent部分的简化示例:
Controller.cs
即使MSDN指出TargetFolderName为
对于使用参数替换来创建文件夹名称或使用无法在.zip文件中直接使用的国际字符串命名文件夹很有用。
尽管如此,我还是无法完成这项工作。
输入“ TestArea ”的预期结果:
TestArea |__ TestAreaController.cs
实际结果:
$AreaName$ |__ TestAreaController.cs
有人可以帮忙吗?
提前致谢。
刚刚在这里找到了解决方法:
我可以使用Visual Studio项目模板创建新文件夹吗
所以这就是我解决的方法:
<TemplateContent> <ProjectItem ReplaceParameters="true" TargetFileName="$AreaName$\$AreaName$Controller.cs">Controller.cs</ProjectItem> </TemplateContent>