[SOLVED] Conent.RootDirectory gets null

So I had troubles with some other stuff which is still open but I was able to get it working somehow.

Now I am having problems with the Content.RootDirectory = “Content” as It recieves null. I only updated the MonoGame Framework to the latest Dev Build v3.8.0.76 and the MonoGame.Extended to v3.6.0-pullrequest0553-0974.

I am not sure what I have to change.

It also only throws the error when starting the game.

First why would I want to set it to content? That’s the default value.
Second I’m not sure that content at that point the the game, try at the load content

it was the default generated code and I thought that it set’s the Content-Folder Direction to that variable.

When I move it out of public game1() it start’s the game opens the window and instantly closes it again

I found out that it happens when I install a MonoGame.Extended version higher than 1.1.0
I guess that they changed something but I still need some of the latest dev builds

ok got it working. It was only fcked up when I installed Monogame.Extended with a higher version than 1.1.0 via NuGet VS Studio.
Downloaded the latest stuff from github and building it locally.
At least it doesn’t throw a null pointer exception on start anymore.

@MrMinemeet I didn’t understand this issue before but I think I understand it now. I wrote about it on this pull request last night.

Here’s the excerpt:

None of the demos are working because they are either throwing a null reference exception or simply exiting immediately when the game runs.

The good news is I think I understand why it’s happening. It’s most likely got to do with how NuGet is resolving the package version.

See, the way a PCL bait and switch is supposed to work is that MonoGame.Extended references the PCL version of MonoGame (in this case MonoGame.Framework.Portable version 3.7.0.1708) and then the “real” game references a platform specific version of MonoGame (in this case MonoGame.Framework.DesktopGL.Core version 3.7.0.7).

The problem is (I think) when NuGet resolves which version of the DLL to use it sees that the PCL version is higher than the DesktopGL.Core version and uses the wrong one.

So to fix this we either need the DesktopGL.Core version to be the same or higher version than the PCL or to put it another way we need the PCL to be lower than the DesktopGL.Core version.

I hope that at least helps you understand why it’s happening.

Cheers.

I found it out when I build the latest stuff from github myself as it was working.

This is still happening - using Monogame 3.7.1 and the Extended packages from NuGet. How do I actually fix this without esoteric building of packages manually?

Removing Extended doesn’t fix this anymore either for some reason.

This error happened twice to me and it always happened after requiring Pipeline related package, the last time (today) was after importing MonoGame.Framework.Content.Pipeline.Portable

The first time I fixed it by recreating a new project and copying my source code except the binaries but this is really inconvenient.

This time I tried to reboot pc, delete bin/ and removing packages and reimported them but it did’nt fix anything this time. Does someone as a clear protocol to fix this error without having to recreate a new project?