Solution: An assembly with the same simple name 'MonoGame.Framework' has already been imported.

Hello everyone, I have recently experienced a problem and found the solution that maybe helpful for people in the future. Hence this post.

The problem occured after updating visual studio and coming back to an existing monogame project that contains shared code in a .NetStandard project referencing the ‘Monogame.Framework.Portable’ nuget. This doesnt effect android but does effect IOS for some reason.

The Error
CS1704 An assembly with the same simple name ‘MonoGame.Framework’ has already been imported. Try removing one of the references

The Solution
This appears to be because the ‘PrivateAssets’ flag on the package reference for Nuget has been changed. This value now needs to be ‘all’ (not true)

Follow these steps

  1. In your .NetStandard project go to ‘Dependancies->Packages’
  2. Select the Monogame.Framework.Portable package
  3. In the properties window you will see the value for ‘Private Assets’. Type ‘all’ into here
  4. Save and build

I hope this helps people in the future.

Paul

1 Like