public void UpdateProject(MSBuildProject msproject)
        {
            NuGetPackageForcedImportsRemover importsRemover = ForcedImportsRemover;

            if (importsRemover != null)
            {
                importsRemover.UpdateProject(msproject);
            }

            EnsureNuGetPackageBuildImportsTargetUpdater currentUpdater = Updater;

            if (currentUpdater != null)
            {
                currentUpdater.UpdateProject(msproject);
            }

            NuGetPackageNewImportsHandler importsHandler = NewImportsHandler;

            if (importsHandler != null)
            {
                importsHandler.UpdateProject(msproject);
            }

            ConditionalPackageReferenceHandler packageReferenceHandler = ConditionalPackageReferenceHandler;

            if (packageReferenceHandler != null)
            {
                packageReferenceHandler.UpdateProject(msproject);
            }
        }
Example #2
0
 async Task <bool> AddConditionalPackageReference(
     PackageIdentity packageIdentity,
     INuGetProjectContext context,
     BuildIntegratedInstallationContext installationContext)
 {
     using (var handler = new ConditionalPackageReferenceHandler()) {
         handler.AddConditionalPackageReference(packageIdentity, context, installationContext);
         await SaveProject();
     }
     return(true);
 }