在VS项目模板向导中获取解决方案/项目的位置

3
我正在为一个项目模板实现向导,并且我想获取用户在新建项目窗口中选择的项目/解决方案路径。我知道有一些参数,如$ saferootprojectname $,可以获取项目名称,但不知道如何获取位置路径。
谢谢!
1个回答

5
在RunStarted方法中,使用replacementsDictionary["$destinationdirectory$"]包含目标目录。
public void RunStarted(object automationObject, Dictionary<string,string> replacementsDictionary, WizardRunKind runKind, object[] customParams) 
{    
     string Path=replacementsDictionary["$destinationdirectory$"];

}

你可以在生成的代码文件中使用"$destinationdirectory$"。
我在这里找到了答案:这里

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接