0

I have created a project template and a VSIX including a wizard which will do some additional stuff before creating the project. Actually we have some custom nugets included in the project which urges the user to restore the nugets after the project was created.

The issue now is that some users (developers) do not have the correct package source configured.

Therefore I am looking for a way to add this particular package source after the project was created by the vsix for example in the "RunFinished" method of my wizard.

I know I can do this by calling:

dotnet nuget add source https://abc.de/index.json -n CustomNugets

But I'm not clear how to to this by code using for example the package manager console. Or can I achieve this just by using

System.Diagnostics.Process

and executing above command with

ProcessInfo = new ProcessStartInfo("cmd.exe", "/C " + MyCommand);

This did not seem to do the job :-/

Does anybody have a hint for me?

0 Answers0