public ProjectNugetPackageAdder(
     IJsonSerializer jsonSerializer,
     ProjectNpmPackageAdder npmPackageAdder,
     DerivedClassFinder moduleClassFinder,
     ModuleClassDependcyAdder moduleClassDependcyAdder,
     IRemoteServiceExceptionHandler remoteServiceExceptionHandler)
 {
     JsonSerializer                = jsonSerializer;
     NpmPackageAdder               = npmPackageAdder;
     ModuleClassFinder             = moduleClassFinder;
     ModuleClassDependcyAdder      = moduleClassDependcyAdder;
     RemoteServiceExceptionHandler = remoteServiceExceptionHandler;
     Logger = NullLogger <ProjectNugetPackageAdder> .Instance;
 }
        public async Task AddAsync(string projectFile, NugetPackageInfo package)
        {
            using (DirectoryHelper.ChangeCurrentDirectory(Path.GetDirectoryName(projectFile)))
            {
                Logger.LogInformation($"Installing '{package.Name}' package to the project '{Path.GetFileNameWithoutExtension(projectFile)}'...");

                CmdHelper.Run("dotnet", "add package " + package.Name);

                var moduleFiles = ModuleClassFinder.Find(projectFile, "AbpModule");
                if (moduleFiles.Count == 0)
                {
                    throw new CliUsageException($"Could not find a class derived from AbpModule in the project {projectFile}");
                }

                if (moduleFiles.Count > 1)
                {
                    throw new CliUsageException($"There are multiple classes derived from AbpModule in the project {projectFile}: " + moduleFiles.JoinAsString(", "));
                }

                ModuleClassDependcyAdder.Add(moduleFiles.First(), package.ModuleClass);

                Logger.LogInformation("Successfully installed.");
            }
        }