我正在为项目模板实现向导,我想获取用户在“新建项目”窗口中选择的项目/解决方案路径。我知道有一些参数,比如 $saferootprojectname$ 来获取项目的名称,但不知道如何获取位置路径
问候
最佳答案
在 RunStarted 方法中,使用 replacementsDictionary["$destinationdirectory$"] 包含目标目录。
public void RunStarted(object automationObject, Dictionary<string,string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
string Path=replacementsDictionary["$destinationdirectory$"];
}
您可以在生成的代码文件中使用“$destinationdirectory$”。
我找到了这个答案 here
关于c# - 在 VS 项目模板向导中获取解决方案/项目的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17344881/