I am working with WinForm App targeting net461 framework. Unfortunately, this warning appeared in runtime error list :
Found conflicts between different versions of "System.Diagnostics.DiagnosticSource" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
Adding to package.config does not helped :
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net461" />
</packages>
Does anybody have an idea about this?
The problem usually arises when different dependencies bring their own version of System.Diagnostics.DiagnosticSource
assembly. It is true for any other assembly conflict as well.
The reason for such behavior lies in a faulty design of .NET Framework but also .NET Core dependency logic. The same warnings were quite often produced by .NET Core coreclr
and corefx
repo builds with only side effects being larger NuGet package containing all conflicting versions of assemblies and even complete frameworks.
The warning itself is benign and can be safely ignored. The only impact is that more packages will be imported by NuGet during the build.