36 Commits
Author SHA1 Message Date
Andy Zivkovic ba112de7ee Make nullable enabled by default across entire repo (#6960) 2025-11-20 21:13:26 +10:30
Nikolche Kolev ad8a6e33a0 Migrate tests using ProjectJsonNugetProject to PR (#6706) 2025-08-15 12:56:09 -07:00
Simon Cropp 721e4df87f use fields instead of private properties (#6577) 2025-08-14 10:29:41 -07:00
Nikolche Kolev a27eada9ee Split Test.Utility into a VS centric one and a core centric one, update dependencies (#6512) 2025-06-24 09:25:58 -07:00
Nikolche Kolev c421dbbb48 Enable IDE0051, unused private method warning, resolve all current violations (#6462) 2025-05-28 10:33:06 -07:00
Kartheek Penagamuri 76148aa8c6 remove unused usings and sort existing ones (#5971) 2024-08-20 21:20:27 +00:00
Andy Zivkovic 8e96cf5c2b NuGetAuditSuppress for packages.config in VS (#5918) 2024-07-30 08:06:34 +09:30
Nikolche Kolev e9bc6f75fe Handle conditional uninstallation in PackageReference based projects (#5532) 2023-12-14 16:03:26 -08:00
Drew Noakes 77d0b0f78a Don't allocate as many Task instances (#5242) 2023-06-21 13:00:26 -07:00
Andy Zivkovic 2bd89a3bc9 Get NuGetAudit properties in VS without DTE (#5149) 2023-04-28 14:19:17 +02:00
Donnie Goodson a20ebbcb10 Extract Test helper classes to Test.Utility (#5052) 2023-02-24 11:23:39 -08:00
Jeff Kluge 20be995d65 Onboard to central package management in NuGet.Client repo (#4899) 2022-11-16 07:43:45 -08:00
Rose f7d1aebf15 Simplification of Any (#4863) 2022-10-26 09:09:46 -07:00
Andy Zivkovic e8f734c1ce NuGetProjectService.GetInstalledPackagesAsync improvements (#4406) 2022-01-25 16:16:20 -08:00
Chris Rummel 3e2fdae24e Apply arcade-powered source-build patches (#4216) 2021-10-08 20:02:46 -07:00
erdem df6f261ee2 Ensure the namespaces filtering is respected in packages.config package installation/updates in PMUI (#4140)
* Project PMUI install action honors Namespace filtering.
2021-07-15 16:34:57 -07:00
Donnie Goodson d3a633a04d Add messages to logs in Tests in thread-safe manner (#4008) 2021-04-20 20:00:23 -04:00
Andy Zivkovic b52bb6fe10 VS nomination errors should create an assets file with the error message (#3818) 2020-12-29 16:12:31 -08:00
Erdembayar YondonandErick Yondon 53a7cf2b5b Fix Nuget Solution Package manager UI is slow because restore is run for every project instead of after all projects are updated (#3559)
* Added relationship table to hold ancesstors and descendents relationship for target projects.

* Now 1065 is solved because we pass correct update PackageSpec of child before parent restores.

* Remove RelationshipTree for now.

* Add unshipped public api.

* Remove unused item and add initial value to dictionary to prevent from null exception.

* More streamline package reference type code restore.

* Revert "More streamline package reference type code restore."

This reverts commit 875968b0a1eb814c0a6cee817673ee56a4f323ce.

* Restore NugetBuiltIntegrated restore works only in 1 pass.

* Minor refactoring for naming.

* Explicit clearing of cache.

* Initial refactoring of moving caching of updated PackageSpec near to usage, make it run parellel not finished yet.

* Made BuiltIntegratedProject project upgrade/downgrade parallel run for faster run.

* Fix minor typos.

* Remove unused methods and variables.

* Remove more unused item.

* Revert "Remove more unused item."

This reverts commit efa178296edb9f2c5bb9c48488a056ec6ef0e334.

* Patching in memory works.

* Cleanup

* Minor text change

* More code cleanup.

* Rename PreviewBuildIntegratedProjectActionsParallelAsync method to PreviewBuildIntegratedProjectsActionsAsync

* Add unit tests for covering PreviewBuildIntegratedProjectsActionsAsync method in NuGetPackageManager.

* Add more unit tests for BuildIntegratedTests

* Address Andy's code review comment.

* Add unit test for DependencyGraphSpec>>WithReplacedPackageSpecs new method I created.

* Get Andy's advise for reduce runtime time complexity.

* Change package versions because it's failing on .NetCore unit tests.

* Check if Newtonsoft version matches.

* Try different pacakge for unit test.

* Test

* Address comment about foreach loop variable name.

* Remove 'parallel' word from comment. Because actual parallel code is called thown the line different method.

* PackageReference/SDK style unit tests start working.

* Making source works for unit tests.

* Fixed problem of Unit test project not picking up my custom PackageSource.

* Revert LegacyPackageReferenceProject related changes, maybe I don't need it for now.

* Git clean up and fix added unit tests with new PackSource logic.

* Fix typo.

* Add NU1065 and new PackageSource handling to some unit test I forgot to add.

* Fix formatting recommendation in code review.

* Remove parallel wording from method comment, because actual parallelization happend down the line another called method here.

* Fix typo.

* Refactor code after Andy's code review.
thinking about API design:

	Why does this method only accept BuildIntegratedNuGetProject?
	Why can't this method be made internal, and the existing public API PreviewInstallPackageAsync calls it for compatible project types?

* Fix small typo.

* After refactoring code PreviewBuildIntegratedProjectActionsAsync and PreviewBuildIntegratedProjectActionsAsync share same logic via PreviewBuildIntegratedProjectsActionsAsync
method.

* All PreviewProjectsInstallPackageAsync related unit test for NugetPackageManager are ported to NetCorePackageReferenceProject(reference) type unit test from project json type unit tests.

* Remove the spaces and correct comments.

* Revert changes to BuildIntegratedTests.cs since we already ported all new unit tests to NetCorePackageReferenceProjectTests.cs

* Fix typo.

* Revert changes to LegacyPackageReferenceProjectTests.cs

* Revert back unneeded changes to NuGetPackageManagerTests.cs

* Remove unneeded change.

* Add missing copy right notice for new file GetPackageReferenceUtility.cs

* Add missing copyright notice for ProjectInstalledPackages.cs

* Remove wrong file.

* Revert unneeded changes.

* Fix typos.

* Address code review comments and clean up.

* Now also remembers we evaluated the parents too.

* Rename method name after nkolve92 code review.

* Address Nikolche code review comment about parent projects.

* Remove method PreviewResolveActionsForBuildIntegratedProjectsAsync method since it's so simple.

* Make sure restore happens only once during uninstall process for chain referenced projects.  Address: https://github.com/NuGet/Home/issues/9932#issuecomment-679439201

* Changed install package to all projects that it check for restore only happens once per project.

* Clean up unused items.

* Replace StringComparer.OrdinalIgnoreCase with PathUtility.GetStringComparerBasedOnOS() for other OS compatibility.

* Refactor the unit tests after Nikolche's code review.

* Change unit test names.

* Fix formatting.

* Fix with dot net formatting.

* Add comment why we're separating BuildIntegratedNuGetProject vs packages.config projects.

* Address more code review comments by Cristina.

* Address Svet's code review comment.

* Fix formatting.

* Address Andy's latest code review.

* Refactor unit test after Andy's code review.

* Fix unit test after Nikolche review.

* Fix formatting.

Co-authored-by: Erick Yondon <eryondon@microsoft.com>
2020-09-03 08:04:39 -07:00
Kat Marchán 65abcc61f7 automatic formatting (#3587)
Fixes: https://github.com/NuGet/Client.Engineering/issues/487
2020-08-26 15:08:11 -07:00
Andy Zivkovic efdb0003e0 Merge packages.config content hash enforcement (#2923) 2019-07-11 16:35:37 -07:00
Patricio Beltran f7143c48d8 Refactor AllowListVerificationProvider (#2454)
* SignedPackageVerifierSettings should not have allowList information

* allowListVerificationProvider should only receive one allowList
2018-10-09 15:32:05 -05:00
Ankit Mishra eea7861669 Display signing warnings on package install in VS (#2353)
## Bug
Fixes: https://github.com/NuGet/Home/issues/6318  
Regression: No

## Fix
Details: This PR adds support, in `INuGetProjectContext` and all of its child types, to log/error using `ILogMessage`. This primarily improves package install scenarios into classic csproj, where warnings were logged into the output console but not displayed in the VS error list.

Further, this fixes a regression caused by https://github.com/NuGet/NuGet.Client/commit/d0f97b53c1850d7209723afc7aa85986beabe3b8 where the error list would not clear on solution close and build.

## Testing/Validation
Tests Added: No  
Reason for not adding tests:  UI change
Validation done:  manual validation
2018-07-19 11:18:41 -07:00
Ankit Mishra 957e9e0590 Revert "Add ProjectId to PackageSpec and ProjectRestoreInformation (#2279)" (#2323)
This reverts commit f4f146fced.

Seems this commit has caused perf regression. We need to revert this to unblock insertions and work on a fix.
2018-06-29 15:17:12 -07:00
Ankit Mishra f4f146fced Add ProjectId to PackageSpec and ProjectRestoreInformation (#2279)
## Bug
`ProjectRestoreInformation` data event was missing `ProjectId` that can be used to correlate it to `Projectinformation` data event inside VS.

## Fix
Details: I have added `ProjectId` to the `PackageSpec` for `LegacyPackageReferenceProject`, `MSBuildNuGetProject`, `ProjectJsonNuGetProject` and `NetCorePackageReferenceProject` via `VsSolutionRestoreService`.

The logic is implemented in `NuGetProject` which read the `ProjectId` from `InternalMetadata` and returns an empty string if it is not found.

## Testing/Validation
Tests Added: Yes
Validation done:  Manual validation using vstelmon
2018-06-07 14:10:09 -07:00
Ankit Mishra d970cfdf3b Add support for verifying signed package against Repository Signature Info (#2139)
## Bug
Fixes: https://github.com/NuGet/Home/issues/6700
Regression: No

## Fix
Details: This PR adds the following - 

1.  Updates SignedPackageVerifierSettings to contain 4 additional fields -
     - `bool AllowNoRepositoryCertificateList`
     - `bool AllowNoClientCertificateList`
     - `IReadOnlyList<VerificationAllowListEntry> RepositoryCertificateList`
     - `IReadOnlyList<VerificationAllowListEntry> ClientCertificateList`
     The new fields allow us to pass client and repository allow lists to `AllowListVerificationProvider`
2. Refactor `ISignatureVerificationProvider` to accept allow lists via `SignedPackageVerifierSettings`
3. Add `RepositorySignatureInfoUtility` to process `RepositorySignatureInfo` and generate effective `SignedPackageVerifierSettings`.
4. Update `PackageExtractor` to check if the download source has `RepositorySignatureInfo` and use that to verify signed packages.
5. Supporting refactoring and tests.
2018-04-06 09:10:58 -07:00
Zhi Li 98fd6e140c added signing telemetry data 2018-02-06 16:12:12 -08:00
Zhi Li b896fdd030 telemetry refactoring 2018-01-19 17:00:12 -08:00
Zhi Li e91dbf3ec3 Add sign verification for unzip 2017-10-31 12:56:36 -07:00
Ankit Mishra 8d714434df Revert "add verify for package install and restore"
This reverts commit fe4f5cc78a.
2017-10-13 16:57:04 -07:00
Zhi Li fe4f5cc78a add verify for package install and restore 2017-10-13 16:30:35 -07:00
Damon Tivel fee9da08b6 Call VS service on UI thread (#1463) 2017-06-06 11:22:23 -07:00
Alex Panov af0ac322bf Fixed 💯 functional tests failing on CI (#1415)
Resolves NuGet/Home#5290.

Fixed failing functional tests:
🔨 💯 CI tests failed on MAC due to a stack overflow bug in `MSBuildLogger`
🔨  `BuildIntegratedTests.TestPacManBuildIntegratedInstallPackageWithInitPS1` 	
🔨  `BuildIntegratedTests.TestPacManBuildIntegratedUpdatePackageCallsInitPs1OnNewPackages`	
🔨  `MSBuildNuGetProjectTests.TestMSBuildNuGetProjectPSInstallAndInit`	
🔨  `MSBuildNuGetProjectTests.TestMSBuildNuGetProjectPSUninstall`
2017-05-29 14:02:19 -07:00
Alex Panov 7985322db4 Lightweight solution load: Merge feature branch (#1379)
* Lightweight solution load: Merge feature branch

This change summarizes feature work done to enable full support of LSL
in NuGet Package Manager.

Main concepts introduced

- `IVsProjectAdapter` - An abstraction layer over `EnvDTE.Project`.
Represents a virtual project object. It is aware of LSL mode and is
capable to force load project when it's needed. All occurances of DTE
project have been replaced with new adapter object.

- `INuGetProjectServices` - Collection of project services as building
blocks to access underlying project system functionality, such as
reference reader, build properties, project system capabilites, script host.

- `VsCoreProjectSystemService` - Implementation of project services for VS
  core project system (DTE).

- `VsLangProjectSystemService` - Implementation of project services for
  managed languages project system (VsLangProj80).

- `WorkspaceProjectServices` - Implementation of project services for
  deferred projects based on Workspace* API.

Notable refactorings
- Decommissioned `EnvDTEProjectAdapter` in favour of the new adapter.
- `LegacyCSProjPackageReferenceProject` =>
  `LegacyPackageReferenceProject`.
- `CpsPackageReferenceProject` => `NetCorePackageReferenceProject`
- Multiple renamings to avoid confusion betwen projects and project
  systems.

Resolves NuGet/Home#5180.

* Cumulative PR feedback plus bug fixes

* Applied recommended design changes

* [BUG 441140] An error dialog pop up when creating C# ASP.NET Sigle Page Application

Fixes internal bug 441140.
2017-05-26 17:50:49 -07:00
Justin Emgarten c282092fc5 De-duplicate strings for v2 and v3 feed parsers
Merging into the migrated 4.3.0 branch, original changes are from @scottbommarito

Creates a `MetadataReferenceCache` class. It caches references to `string`s and `NuGetVersion`s and can be used to replace duplicate values in our metadata models. The cache only lives for a short amount of time--a single request--so it does not take up significant amounts of memory itself.

Also added a couple fields to particular models.
- `V2FeedPackageInfo` and `PackageSearchMetadataV2Feed` now have `Created` and `LastEdited`, which are exposed in the feed.
- `PackageSearchMetadataRegistration` is a subclass of `PackageSearchMetadata` that contains a `CatalogUri` and is returned by `PackageMetadataResourceV3`.
2017-04-10 18:20:43 -07:00
Justin Emgarten 7c5404ba65 Merging test utilities into Test.Utility
Merging all test utilities together. Test.Utility is now a common layer that all tests can use that sits between the product projects and test projects.
2017-03-30 18:03:12 -07:00