Error effect is compiled for a different platform

I’m using a shared library (which uses the DesktopGL package) and a Windows DX project referencing the shared library. I am also using a shared content folder. The content is compiled for Windows. All the logic including loading content is in the shared library. When I run the game, I get an error saying “The effect was compiled for a different platform.”

I tried compiling the content for DesktopGL and moving it into the bin folder in the Windows DX project, and it worked. I don’t why compiling for Windows isn’t working even though it is a Windows DX project.

I’m using MonoGame 3.8 (I’m actually trying to upgrade an old project from MonoGame 3.7) and .NET 5. This error did not occur before.

Please help!