NetStandar project could not be referenced in UWP Project

hello folks, sorry for the bad english,
I’m a little bit new in monogame, I have creating a share project with different platform builds… MacOS and DesktopGL so far.
I’m using a Netstandar2.0 project with monogame.framework.Portable in its dependencies, I’m using this project as a share code between Startup projects.

war_tank = share code project;
war_tank.UWP = startup project to UWP;

I have trying to create a UWP project, it works fine before I include the share code project as a referenced project (war_tank)

After that, something goes wrong, when I run the project it try to run MonoGame.Framework.GameFrameworkViewSource in diffrent assembly, the share code project’s assembly (MonoGame.Framework, Version=3.7.1.189).

And launch this exeption: Could not load type 'MonoGame.Framework.GameFrameworkViewSource from assembly ‘MonoGame.Framework, Version=3.7.1.189, Culture=neutral, PublicKeyToken=null’.

I wonder why this is happening. Why it’s changing assembly?
I really appreciate any help to solve this problem or any information to improve me in assembly concerns.
Thanks in advance!

I’ve seen this error caused by a few different things, but when using NET Standard, check that you have PrivateAssets All set in the project file.

In your csproj there should be a PackageReference to the Monogame Nuget. Make sure that it looks something like this (note I’m using the 3.8 beta here) :

<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1375-develop" >
  <PrivateAssets>all</PrivateAssets>
</PackageReference>
2 Likes