简体   繁体   中英

Unable to run a MonoGame project on a clean installation of Visual Studio and MonoGame

I recently got a new computer, and finally got around to installing MonoGame, as I worked with it a few months back on my old computer, and primarily use Unity for my game development when not working on 2D games. Their website says they have CLI templates that work with Rider, but I figured it would be best to get it installed with Visual Studio first. Following the exact steps listed on the MonoGame website, I got everything installed that I needed, and started a project from one of the Visual Studio MonoGame templates. Upon opening the project, and everything finishing loading, I am greeted to this miserable sight . I also had an error in the console relating to MonoGame, with the error code MSB3073 . From what research I did, I found that it either had to do with my username having a space in it (it clearly does not, so that was out of the picture), or it had to do with using the Visual Studio templates, and I would simply need to create the project from the CLI templates, as seen here . However, creating a new project from the CLI templates does not change anything. I have tried uninstalling and reinstalling dotnet, I have tried uninstalling and reinstalling Visual Studio. I have, of course, powered my computer off and back on multiple times. Even trying to open the project in Rider after installing the proper MonoGame packages in the program has the same exact errors. But when I zipped the project up and sent it to a friend who works with MonoGame, he was able to run the project with no issues, so clearly it has something to do with my setup.

I have also cleaned my nuget cache, cleared my project temp folders, and cleared the visual studio cache. Eventually, the Microsoft dependencies stop having issues when I simply close and open the project again, but every time I open the project in Visual Studio, I get the same error in the console, and it prevents me from running/building the project.

Hoping someone on here will know what to do with the info I've given, as I'm completely out of ideas!

So I figured it out. I'm not very experienced with the command line, but I managed to find avery nice tutorial by someone who wanted to make games with MonoGame using only the command line. In it, I was able to attempt to build the project from the CLI, and it gave me an error message unlike what was in Visual Studio. It said that MonoGame only works on a 64bit OS, but I'm on a 64bit OS. So I went to look at what version of dotnet was being used, and sure enough, it was the 32 bit version, It took a while to figure out how to uninstall it. and how to use the dotnet-core-uninstaller tool in the command line. Then all I had to do was remove the Environment Variable in the System category for the Path variable that referenced the Program Files (x86) directory of dotnet.

Hopefully if anybody else comes across this issue, they'll find this post, as none of the others seemed to fully explain how to do anything that needed to be done to fix the problem:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM