【问题标题】:Get location of a solution/project in VS project template Wizard在 VS 项目模板向导中获取解决方案/项目的位置
【发布时间】:2023-03-10 12:37:02
【问题描述】:

我正在为项目模板实施向导,我想获取用户在“新建项目”窗口中选择的项目/解决方案路径。我知道有某些参数,如 $saferootprojectname$ 来获取项目的名称,但不知道如何获取位置路径

问候

【问题讨论】:

    标签: c# visual-studio-2010 nuget nuget-package project-template


    【解决方案1】:

    在 RunStarted 方法上,使用 replacementsDictionary["$destinationdirectory$"] 包含目标目录。

    public void RunStarted(object automationObject, Dictionary<string,string> replacementsDictionary, WizardRunKind runKind, object[] customParams) 
    {    
         string Path=replacementsDictionary["$destinationdirectory$"];
    
    }
    

    您可以在生成的代码文件中使用“$destinationdirectory$”。

    我找到了这个答案here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多