问题
I just installed Visual Studio 2015 and now want to start a new MonoGame project (C#, Windows DX). I got MonoGame installed, as well as XNA.
The problem is that the templates are not showing up in the New Project dialogue.
On Visual Studio 2013, they showed up here, they are also nowhere to be found aynwhere else in the Project tree.
So I searched for the templates, they exist in the location where they should be:
C:\Users\<user>\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\MonoGame
I tried running the devenv.exe /installvstemplates
from the Visual Studio admin console, as well as devenv.exe /setup
, for good measure.
After doing both several times, mixed with a few Visual Studio 2015 and Windows restarts, the project templates are still not showing up.
I also tried to clear the cache by deleting C:\Users\<user>\AppData\Roaming\Microsoft\VisualStudio
and C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\14.0
, to no avail.
The MonoGame installer was customized to work with Visual Studio 2015, so I assume it should work somehow.
So, can anyone help me getting those project templates set up?
回答1:
I found out why it wasn't working:
Apparently, the MonoGame installer puts the Templates in the wrong folder for Visual Studio 2015.
The correct folder for VS2015 is
C:\Users\user\Documents\Visual Studio 14\Templates\ProjectTemplates\Visual C#
The MonoGame installer installs to C:\Users\user\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#
So, when the folder MonoGame inside that folder gets moved to the first one, and the devenv.exe /installvstemplates
command gets executed, the templates show up.
回答2:
In case you work as standard user and run MonoGame setup as admin, MonoGane templates was installed only in Administrator account.
So I just make copy into my user \ProjectTemplates\Visual C#
.
MonoGame Setup installation:
C:\Users\**Admin**\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#
Correct folder is under my user account:
C:\Users\**user**\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#
Then as answered above just run devenv.exe /installvstemplates
from Developer Command Prompt for VS2015.
来源:https://stackoverflow.com/questions/31893755/monogame-templates-in-visual-studio-2015