DEV Community

Sardar Mudassar Ali Khan
Sardar Mudassar Ali Khan

Posted on

How to solve NU1065 detected package downgrade in visual studio

The error message "NU1065 detected package downgrade" typically occurs when there is a conflict between packages in a Visual Studio project. It indicates that a package being referenced has a lower version than what is required by another package.

To solve the NU1065 error, you can try the following steps:

Update Packages:

First, ensure that you have the latest versions of the packages in your project. Right-click on your project in Visual Studio's Solution Explorer and select "Manage NuGet Packages." In the NuGet Package Manager, go to the "Updates" tab and update all packages to their latest versions. This might resolve any version conflicts.

Check Package Compatibility:

Verify the compatibility of the packages you are using. Some packages may have specific version requirements or dependencies. Make sure that all the packages you are using are compatible with each other and meet the required versions. You can check the package documentation or the NuGet package website for compatibility information.

Review Package References:

Inspect the references to the packages in your project. Check if there are multiple references to the same package but with different versions. In Visual Studio's Solution Explorer, expand the "References" section and review the packages listed there. Ensure that there are no conflicting versions of the same package. Remove any duplicate or conflicting references.

Clear NuGet Cache:

If the above steps do not resolve the issue, clearing the NuGet package cache can sometimes help. Close Visual Studio and navigate to the following directory: %userprofile%.nuget\packages. Delete all the folders and files present in this directory. Then reopen Visual Studio and rebuild your project. Visual Studio will restore the packages and create a fresh cache.

Manual Package Updates:

If none of the above steps work, you may need to manually update or downgrade the conflicting packages. To do this, right-click on your project in the Solution Explorer, select "Manage NuGet Packages," and go to the "Browse" tab. Search for the specific package causing the issue and install the desired version. Keep an eye on the version compatibility with other packages.

Contact Package Maintainers:

If you're still facing issues, you can reach out to the maintainers or community of the specific packages that are causing the conflict. They might be able to provide guidance or solutions tailored to their packages.

Remember to rebuild your project after implementing any changes to verify if the NU1065 error has been resolved.

Top comments (0)