You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/consume-packages/Package-References-in-Project-Files.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -392,6 +392,42 @@ You can control various behaviors of restore with lock file as described below:
392
392
|`-ForceEvaluate`|`--force-evaluate`| RestoreForceEvaluate | This option is useful with packages with floating version defined in the project. By default, NuGet restore will not update the package version automatically upon each restore unless you run restore with this option. |
393
393
|`-LockFilePath`|`--lock-file-path`| NuGetLockFilePath | Defines a custom lock file location for a project. By default, NuGet supports `packages.lock.json` at the root directory. If you have multiple projects in the same directory, NuGet supports project specific lock file `packages.<project_name>.lock.json`|
394
394
395
+
## NuGet Dependency Resolver
396
+
397
+
The NuGet dependency resolver follows the [4 rules as described in the dependency resolution document](../../docs/concepts/Dependency-Resolution.md).
398
+
399
+
In order to improve the performance and scalability of the restore operation, the restore algorithm was rewritten in the 6.12 release.
400
+
As of the 6.12 release, the new restore algorithm is enabled by default for all PackageReference projects.
401
+
While the new restore algorithm is is functionally equivalent to the previous one, as with any software, bugs are possible.
402
+
To revert to the previous implementation, set the MSBuild property `RestoreUseLegacyDependencyResolver` to `true`.
403
+
404
+
Should you face restore failures in 6.12, .NET 9 or 17.12, that weren't reproducing in earlier versions, please [file an issue on GitHub](https://github.com/NuGet/Home/issues/).
405
+
Any differences between the old and new algorithms may have different impacts, such as during compilation or at runtime.
406
+
There's also a chance that changes don't lead to failures, but different package versions being restored.
407
+
If you think you may be impacted by any changes, here are the steps you can take to verify whether the changes in the NuGet restore algorithm are the root cause.
408
+
409
+
Restore writes its results in the `MSBuildProjectExtensionsPath` directory, which can be compared with the new and old algorithms to find differences.
410
+
Usually this is the `obj` folder of your build.
411
+
You can use `msbuild.exe` or `dotnet.exe` for the next steps.
412
+
413
+
1. Remove the `obj` folder for your project.
414
+
1. Run `msbuild -t:restore`
415
+
1. Save the contents of the `obj` to a location indicating that it's the `new` behavior.
416
+
1. Run `msbuild -t:restore -p:RestoreUseLegacyDependencyResolver="true"`
417
+
1. Save the contents of the `obj` to a location indicating that it's the `legacy` behavior.
418
+
1. Compare the files in the two directories, particularly *project.assets.json*.
419
+
Tools that can highlight differences are especially useful for this (for example, Visual Studio Code, open both files, and use the right-click "select for compare" and "compare to selected")
420
+
421
+
If you follow the above method, there should be exactly 1 difference between the `project.assets.json` files:
422
+
423
+
```diff
424
+
"projectStyle": "PackageReference",
425
+
+ "restoreUseLegacyDependencyResolver": true,
426
+
"fallbackFolders": [
427
+
```
428
+
429
+
If there are any more differences, please [file an issue on GitHub](https://github.com/NuGet/Home/issues/) with all the details.
430
+
395
431
## AssetTargetFallback
396
432
397
433
The `AssetTargetFallback` property lets you specify additional compatible framework versions for projects that your project references and NuGet packages that your project consumes.
> Invalid value for `--certificate-fingerprint` option in the `dotnet nuget sign` command or the `CertificateFingerprint` option in the `NuGet.exe sign` command.
14
+
The value must be a SHA-256, SHA-384, or SHA-512 certificate fingerprint (in hexadecimal).
15
+
16
+
> This warning will be promoted to an error around the .NET 10 timeframe.
17
+
18
+
## Issue
19
+
20
+
Starting with .NET 9 and NuGet.exe 6.12, NU3043 warning is raised when a SHA-1 certificate fingerprint is passed to the sign commands.
21
+
SHA-1 is considered insecure and should no longer be used.
22
+
23
+
## Solution
24
+
25
+
To resolve this warning, ensure that you provide a valid SHA-256, SHA-384, or SHA-512 certificate fingerprint (in hexadecimal) for the `--certificate-fingerprint` option in the `dotnet nuget sign` command or the `CertificateFingerprint` option in the `NuGet.exe sign` command.
26
+
27
+
Customers can use the following PowerShell script to compute SHA-2 family hashes for certificates.
28
+
To use the script, customers need to save the certificate to a local folder.
Copy file name to clipboardExpand all lines: docs/reference/msbuild-targets.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -444,6 +444,7 @@ Additional restore settings may come from MSBuild properties in the project file
444
444
|`RestorePackagesConfig`| An opt-in switch, that restores projects with packages.config. Support with `MSBuild -t:restore` only. |
445
445
|`RestoreRepositoryPath`| packages.config only. Specifies the packages directory to which the packages should be restored. `SolutionDirectory` will be used if not specified. |
446
446
|`RestoreUseStaticGraphEvaluation`| An opt-in switch to use static graph MSBuild evaluation instead of the standard evaluation. Static graph evaluation is an experimental feature that's significantly faster for large repos and solutions. |
447
+
|`RestoreUseLegacyDependencyResolver`| An opt-out to use the legacy dependency resolver. NuGet's dependency resolver implementation was rewritten in the [6.12 release](../../docs/release-notes/NuGet-6.12.md). This switch forces the previous algorithm to be used. |
447
448
448
449
The `ExcludeRestorePackageImports` property is an internal property used by NuGet.
449
450
It should not be modified or set in any MSBuild files.
0 commit comments