gpt4 book ai didi

visual-studio-templates - Visual Studio 模板参数不返回值?

转载 作者:行者123 更新时间:2023-12-02 04:12:00 25 4
gpt4 key购买 nike

我试图在创建 Visual Studio 模板时获取这些参数,但它不返回值,它只是保持这样:

string rootnamespace = $rootnamespace$; // this is the output, it just stays as it was declared
string SpecificSolutionName = $SpecificSolutionName$; // this is the output, it just stays as it was declared

根据msdn - Template Parameters :

SpecificSolutionName: The name of the solution. When "create solution directory" is checked, SpecificSolutionName has the solution name. When "create solution directory" is not checked, SpecificSolutionName is blank.

我确保选中了“创建解决方案目录”,但它仍然没有给出任何值。

我怎样才能得到这些值。请...?

最佳答案

我还发现 $SpecificSolutionName$ 已损坏。作为解决方案,解决方案的目录通常与解决方案的名称相同,因此:

  • 如果您的解决方案模板只有 1 个项目:解决方案和项目名称相同,因此您可以简单地使用 $projectname$ 代替损坏的 $SpecificSolutionName$。

  • 如果您的解决方案模板有多个项目(也称为 ProjectCollection):将属性 CopyParameters="true"添加到所需的 ProjectTemplateLink 元素,并使用 $ext_projectname$ 代替损坏的 $SpecificSolutionName$。

关于visual-studio-templates - Visual Studio 模板参数不返回值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29732550/

25 4 0