Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

.NET Tools

9 Things You Didn’t Know About JetBrains Rider’s NuGet Support

Introducing package managers into the modern development workflow has been nothing short of transformative. If you’ve been a .NET developer for a long time, you may remember when we shared .dll files on community sites and consumed them from a lib folder at the root of our solution. Thanks to NuGet, those dark days of .NET are over, and we are all the more productive for it.

When a .NET developer mentions NuGet, they could refer to several concepts. 

For instance, NuGet is a hosting service provided by Microsoft that makes community packages available through an API. This service also has a public UI in the form of NuGet.org. On the site, developers can search for new and existing packages to add to their applications.

Other mentions of NuGet could refer to the local executable, a powerful tool that puts you in control of your package management. It manages interaction with the hosting service, package caches, package sources, and more. You can access the tool using the dotnet CLI tooling.

dotnet nuget --help

In this post, we’ll look at nine exciting features of JetBrains Rider’s integration with NuGet, the service and tooling you may not have known. Let’s get into it!

The NuGet Tool Window and Info Galore

JetBrains Rider spoils us with the information found in the NuGet Tool Window. This window provides direct access to package search results and additional information about a package and its dependencies.

NuGet Tool Window in JetBrains Rider showing installed packages

In the screenshot, you’ll see you have access to a package, any packages it implicitly installs, and any crucial links to repositories, documentation, licenses, and the supported target frameworks.

Note: Use the arrow keys and press Alt+Enter to work with the NuGet tool window even faster.

This information can help you make an informed decision about whether to install any package. Rather than trying to remember packages by name and potentially installing an incorrect package, we’ve spent considerable time creating a well-thought-out experience that will significantly save JetBrains Rider users time.

Sources Management

Enterprise developers typically rely on public and private NuGet package sources, and understanding where a package’s install source is is critical to professional software development.

In the NuGet Tool Window’s Sources tab, developers can see all the NuGet sources and their order of precedence concerning package resolution.

Sources tab in NuGet Tool Window showing the paths to config files.

You can also manage sources by adding and removing feeds from each source layer. Have complete control over your package consumption workflow.

Cache Management

The NuGet tooling caches installed packages in system directories that many developers may be unfamiliar with. JetBrains Rider surfaces these NuGet cache folders so you can stay informed about the resources NuGet is utilizing in your development environment.

Folders tab in NuGet Tool Window showing all the caching folders NuGet uses.

The cache helps improve package installation across solutions, but as packages get versioned and updated by authors, your cache can become weighed down by outdated, obsolete, and unused packages. 

Use JetBrains Rider to clear any caches and free up critical resources.

Open Packages in Assembly Explorer

Package authors and curious developers will appreciate that JetBrains Rider allows them to open any installed packages (explicitly or implicitly) in the Assembly Explorer.

This view can help you diagnose and quickly fix packing issues in a package.

Assembly Explorer showing a NuGet Package

Assembly Explorer in JetBrains Rider is a powerful tool that allows you to open any assembly using the dotPeek decompiler integration. This feature enables you to explore the delivered code within each package, giving you a deeper understanding of the package’s functionality.

Prerelease Checkbox

Package authors will publish prerelease packages on the NuGet service for those other developers who love living on the edge. These packages provide functionality that’s still early and evolving but ready for user feedback.

Prerelease checkbox in NuGet Tool Window

To try out newer .NET ecosystem features and libraries, check the Prerelease box for the experimental and preview packages.

Security with Checkmarx

Security is a serious subject, and our NuGet tool helps keep you informed about the latest security vulnerabilities in your dependencies with Checkmarx advisories.

Checkmarx warning for a vulnerable package in NuGet Tool Window

If you have installed or will install a vulnerable package, you will see a warning in your tool window. Vulnerabilities will also surface in JetBrains Rider’s Problem View.

Checkmarx warning in the problems tool window

Don’t miss a chance to keep your users safe from security threats.

Find Dependent Code

If you’ve ever looked at a package and wondered, “What the heck does this do?” then you’re not alone. In JetBrains Rider, you can right-click any NuGet package, select Find Dependent Code, and find the parts of the codebase that rely on the code within the package.

Find Dependent Code (All Projects) option in context menu for nuget dependency

Once selected, you’ll see a Find window with all the locations that depend on symbols from the package.

The results of finding all the dependent code.

The feature can help you determine how critical a dependency is to your solution and whether it’s worth upgrading, removing, or leaving alone.

Upgrade Packages All At Once

.NET developers are famous (or infamous, depending on who you ask) for having many packages for one logical dependency. With JetBrains Rider, you can easily upgrade multiple packages using the Upgrade packages in Solution dialog.

Upgrade packages in Solution dialog with a few options checked.

Check the packages you want to upgrade collectively and hit the Upgrade button. The dialog and upgrade path will save you time and get you back into the flow.

Note: If you start with search criteria in the NuGet tool window, only those matching installed packages will be carried over to the Upgrade packages in Solution dialog window. For large solutions with many dependencies, this can make the selective upgrade process more pleasant.

Filtered packages based on search criteria.

All Those “Extra” NuGet Settings

NuGet is typically straightforward, but many intricate settings ensure you’re covered. In the Settings window, you can configure NuGet to change the restore behavior, the default credentials providers, search sources, and the uninstall behavior.

NuGet settings window in Rider.

Conclusion

I hope you found this short post informative and helpful. Nobody wants to mess around with opaque tooling where the only information to you exists in a package name. JetBrains Rider’s NuGet integration is a first-class experience thoughtfully designed to increase productivity. With these tips, you should now have the information to install, update, and remove packages confidently.

Check out our official documentation if you’d like to learn more about the NuGet integration. Also, please let us know if you have any questions or comments.

image credit: Jiawei Zhao

image description