Esempio n. 1
0
        public static async Task <ProcessResult> AddPackageToProject(string csprojFilePath, string packageName, string version = "")
        {
            string arguments = string.Empty;

            if (string.IsNullOrEmpty(version))
            {
                arguments = $" add {csprojFilePath} package {packageName} -n";
            }
            else
            {
                arguments = $" add {csprojFilePath} package {packageName} -v {version} -n";
            }

            return(await ProcessAsyncHelper.RunProcessAsync("dotnet",
                                                            arguments,
                                                            30000).ConfigureAwait(false));
        }
Esempio n. 2
0
 public static async Task <ProcessResult> CreateNewDotNetCoreProject(DotNetCoreCommandOptions config)
 {
     return(await ProcessAsyncHelper.RunProcessAsync("dotnet",
                                                     CodeGenerationCoreOperations.GenerateCommandForDotNetCoreProjectCreation(config),
                                                     30000).ConfigureAwait(false));
 }
Esempio n. 3
0
 public static async Task <ProcessResult> AddProjectToSoluion(string solutionPath, string csprojFilePath)
 {
     return(await ProcessAsyncHelper.RunProcessAsync("dotnet",
                                                     $" sln {solutionPath} add {csprojFilePath}",
                                                     30000).ConfigureAwait(false));
 }
Esempio n. 4
0
 public static async Task <ProcessResult> AddProjectReference(string targetProject, string referenceProject)
 {
     return(await ProcessAsyncHelper.RunProcessAsync("dotnet",
                                                     $" add {targetProject} reference {referenceProject}",
                                                     30000).ConfigureAwait(false));
 }