问题
I´m strugling around for some days with visual studio multi project templates installed by an vsix plugin.
What I tried: Stackoverflow 1 AND TONS OF MSDN ARTICLES
The problem/what I want to do:
- Setup a private nuget feed for visual studio in general.
- Install packages from this feed to the subprojects
I thought about using the nuget package restore command, because all the subprojects have their packages.config files but I have no plan how to run that command after the project was created. Is there a way to start e.g. a powershell script that perform such tasks for me?
thanks & greetings Nico
回答1:
If this is part of your own custom VSIX extension, you might want to consider using NuGet via C# itself via NuGet.Core or NuGet.VisualStudio.
You could create your own IWizard and list the packages in the <WizardData>
element in your MyTemplate.vstemplate
definition file.
Although it is using the official NuGet v2 URL, I took this approach to make sure when ever users create a new ServiceStack project via ServiceStackVS, it installs the latest version across all the projects.
The NuGetPackageInstallerMultiProjectWizard class is for use on multi-project templates and checks for the latest version of a specific NuGet dependency specified in the <WizardData>
of the parent template. While the NuGetPackageInstallerWizard is responsible for actually installing the NuGet dependency.
So if you know the URL users will need to use for the required NuGet packages you could take a similar approach.
来源:https://stackoverflow.com/questions/32331655/visual-studio-multi-project-template-restore-all-nuget-packages