The other day I started up my monogame project and started it up to do a quick play test. It wouldn't work. I was getting 2 errors.
Error 1 The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009. GameName1
Error 2 Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\3D Learning\GameName1\GameName1\bin\PSM\IgnoreMe.dll' could not be found C:\Users\Sean\Desktop\Prog\Learning\3D Learning\3D Learning\CSC 3D Learning
And here is the output from the build.
1>------ Build started: Project: Learnplscon, Configuration: PSM Any CPU ------
1> MonoGame Platform PSM
1> 'SETX' is not recognized as an internal or external command,
1> operable program or batch file.
1>C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.ContentPipeline.targets(22,7): error MSB3073: The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009.
2>------ Build started: Project: learnpls, Configuration: Debug x86 ------
2>CSC : error CS0006: Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\learnpls\Learnplscon\Learnplscon\bin\PSM\IgnoreMe.dll' could not be found
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
But Building from last successful build works.
I did not change anything. And any new project I make gets the same problem.
The problem only happens when I add a reference to my content project.
(Referenced project this way: monogame-managing-content )
I made a new project, ran it, everything worked fine. Created a mono game content project, ran it and everything worked fine. Then I added the reference and got the errors. And when I remove the reference Error 2 goes away but error 1 is still there, but the project will run fine.
I have tried reinstalling xna, and monogame. Also tried to reinstall visual studios. I spent all night trying to find an answer online but came up with nothing.
I am using the most recent version of XNA and Monogame 3.2, and I am using windows 8.1.
In case you're still having this problem, or someone else finds the question (like I did trying to solve this a little while ago): for me, the problem was that my windows/system32 directory wasn't in my 'path' environment variable. That's where the setx.exe program resides, and the XNA content project seems to assume that it can call setx without qualifying the path.
Note: Visual Studio seems to need to be restarted after you've added your /system32 directory to the path.