Runt.DesignTimeHost.Host.RestorePackages C# (CSharp) Method

RestorePackages() public method

public RestorePackages ( string runtime, string workingDir ) : System.Threading.Task
runtime string
workingDir string
return System.Threading.Task
        public Task RestorePackages(string runtime, string workingDir)
        {
            return Task.Run(() =>
            {
                var psi = new ProcessStartInfo
                {
                    FileName = Path.Combine(runtime, "klr.exe"),
                    Arguments = String.Format(@"""{0}"" restore",
                                          Path.Combine(runtime, "lib", "Microsoft.Framework.PackageManager", "Microsoft.Framework.PackageManager.dll")),
                    RedirectStandardOutput = true,
                    RedirectStandardError = true,
                    CreateNoWindow = true,
                    UseShellExecute = false,
                    WorkingDirectory = workingDir
                };

                var kreProcess = Process.Start(psi);
                kreProcess.BeginOutputReadLine();
                kreProcess.BeginErrorReadLine();
                kreProcess.EnableRaisingEvents = true;
                kreProcess.WaitForExit();
            });
        }