Microsoft Dev Blogs

Introducing NuGetSolver: A Powerful Tool for Resolving NuGet Dependency Conflicts in Visual Studio

thumbnail

Introducing NuGetSolver: A Powerful Tool for Resolving NuGet Dependency Conflicts in Visual Studio

NuGetSolver is a new experimental Visual Studio extension developed in collaboration with Microsoft Research. It aims to simplify the process of managing dependencies on complex projects by automatically resolving NuGet dependency conflicts.

The extension efficiently tackles common NuGet errors and warnings such as being unable to resolve dependency constraints between packages and having a dependency package specify a version constraint on a higher version than what restore ultimately resolved.

To get started with NuGetSolver, you can download the extension from the VS Marketplace. Once installed, you can run the tool from the "Solution Explorer" by right-clicking and selecting "Resolve Dependency Conflicts". The tool takes into consideration all dependencies and provides intelligent and automated suggestions to resolve conflicts.

By default, NuGetSolver suggests stable versions unless the original version is a preview. If the recommended suggestion looks satisfactory, you can apply the fix and rebuild the solution to check if the conflicts are resolved. It's recommended to enable source control in your repository to easily revert any changes made by NuGetSolver if necessary.

NuGetSolver is a more efficient alternative to upgrading packages one by one using the NuGet Package Manager, especially when there are other dependency constraints. However, multi-targeting is not fully supported yet and applying the fix may not work for all target frameworks.

There are also some limitations to be aware of. Apply Fix doesn't fully support updating versions if custom MSBuild logic is used, and Central Package Management (CPM) is not fully supported. Additionally, NuGetSolver does not verify if suggested versions have known vulnerabilities.

Your feedback on NuGetSolver is important, so be sure to provide any input or suggestions to help improve the tool.