Package System.Drawing.Common 6.0.0 is not compatible with net60
I’ve been trying to write a small application that works with some bitmap images. The way this works was changed by Microsoft not so long ago and this caused me some issues. As I always tend to use an LTS of .NET core I am currently on .NET 6. and this is when this change was introduced.
While I was trying to get some code working I came across this error which frankly made me do a double take — Package System.Drawing.Common 6.0.0 is not compatible with net60. There are some quite drastic suggestions on the web on how to resolve this including a full windows rebuild. Fortunately for me the solution in my case was simple though it does impact the use of the library.
I had the following set in my proj file
<TargetFrameworks>net6.0, netstandard2.0</TargetFrameworks>
This means that there is a clash between the two frameworks due to the changes. Simply removing one of the target frameworks (in my case net standard) resolved this issue