using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; namespace Semmle.BuildAnalyser { /// /// Utilities to run the "dotnet" command. /// static class DotNet { public static int RestoreToDirectory(string projectOrSolutionFile, string packageDirectory) { using var proc = Process.Start("dotnet", $"restore --no-dependencies \"{projectOrSolutionFile}\" --packages \"{packageDirectory}\" /p:DisableImplicitNuGetFallbackFolder=true"); proc.WaitForExit(); return proc.ExitCode; } } }