'Xna' does not exist... randomly after a few weeks?

I’m noticing a strange problem where my projects will work for a couple weeks and with no changes to the project, it will suddenly say ‘Xna’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference). This has happened for multiple projects at random times.

The assembly is referenced. I made no changes since the last time I ran VS 2019 and it worked fine.

I can make a new project, copy the files in and it works again…
for a couple weeks…
then the same problem emerges - seemingly randomly. VS 2019 bug?
I’m hoping to figure out what’s happening, so I don’t have to keep re-making the projects. Any ideas?

[EDIT: Note, I’m using MG 3.8.0.1641 and referencing MG Content builder and MG DesktopGL (3.8.0.1641)]

Are you using templates or building a project from scratch?

Using templates. Works good for several days - it’s very odd. I’d be curious to see if it happens with other packages. I don’t know much about how MS VStudio keeps track of these things.

Hey AlienScribble, I have noticed that if you get XNA running on Visual Studio, and you let it do an update…it will magically jack your stuff up where it is all missing again. So if VS comes up and asks you to update…think about it first :stuck_out_tongue:

1 Like

Aha - good to know. Thanks for the notice. :slight_smile:

I have a wonky internet con sometimes and i noticed this too for me it seems to be connected to the nuget packages i think trying to do some sort of re-initialization check and check for packages on the net.
Sort of makes sense while your debuging and stuff but on release i hope that doesn’t occur.

1 Like

Delete all the bin and obj folders of your project by hand.
This usually helps when VS get’s like that.

Unless it’s an issue with the new nuget/tools build system, in which case try to delete the entire nuget cache folder and/or reinstall the monogame tools.

1 Like

Ah, thanks for the suggestions. So far so good. :slight_smile:

Wait… people still use XNA these days?

Monogame uses XNA namespace for compatibility reasons