私の NuGet パッケージでは、ここに示す方法を使用してソリューション フォルダーを追加します: https://stackoverflow.com/a/6478804/1628707
Init.ps にソリューション フォルダーを追加するコードを次に示します。
$solutionFolder = $solution.AddSolutionFolder("build")
$folderItems = Get-Interface $solutionFolder.ProjectItems ([EnvDTE.ProjectItems])
$files = Get-ChildItem "$buildFolder"
foreach ($file in $files)
{
$folderItems.AddFromFile($file.FullName)
}
次に、Uninstall.ps で、"build" という名前のソリューション フォルダーを削除します。私は次のことを試しました。
//try to get the solution folder. This fails with 'doesn't contain a method named Item'
$proj = $solution.Projects.Item("build")
//So, I tried enumerating and finding the item by name. This works.
foreach ($proj in $solution.Projects)
{
if ($proj.Name -eq "build")
{
$buildFolder = $proj
}
}
//But then removing fails with 'doesn't contain a method named Remove'
$solution.Remove($buildFolder)
私は窮地に立たされており、何か提案をいただければ幸いです。