How to Fix ‘Found Conflicts Between Different Versions of Package’

I try to keep my build jobs free from warnings. Otherwise they tend to grow rapidly, and it gets impossible to notice upcoming problems early on. From time to time a build job throws a warning message like this one:

PrepareForBuild:
Creating directory “bin\Debug\”.
Creating directory “obj\Debug\”.
##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2081,5): Warning MSB3277: Found conflicts between different versions of “System.Threading.Tasks.Extensions” that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.

This time I tried to do what the warning message suggests and turn the log level to detailed. You find the option to change the log verbosity level here in Visual Studio:

  1. In the menu bar, choose Tools > Options.
  2. Search for Build and Run and click on that entry.
  3. In the dropdown list for MSBuild project build output verbosity, select Detailed:

Select Detailed from the dropdown list

This little change produced on the next build nearly 100’000 lines of output for my solution. While this may work for someone else, I could not find anything that helped me to fix the problem.

 

What worked

In the web.config file was a long list of entries to map an old version to a new one like this one here:

I removed all of them, compiled the solution and the warning was gone. Maybe you are lucky, and this is all you need. Otherwise you may need to restore your NuGet packages and let Visual Studio do its magic and recreate the necessary entries. Either way, your warning message should no longer appear.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.