简体   繁体   English

Visual Studio 2015中的MonoGame模板

[英]MonoGame templates in Visual Studio 2015

I just installed Visual Studio 2015 and now want to start a new MonoGame project (C#, Windows DX). 我刚刚安装了Visual Studio 2015,现在想要启动一个新的MonoGame项目(C#,Windows DX)。 I got MonoGame installed, as well as XNA. 我安装了MonoGame,以及XNA。

The problem is that the templates are not showing up in the New Project dialogue. 问题是模板没有出现在New Project对话框中。

在此输入图像描述

On Visual Studio 2013, they showed up here, they are also nowhere to be found aynwhere else in the Project tree. 在Visual Studio 2013上,它们出现在这里,它们也无法在项目树中的其他位置找到。

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. 我尝试从Visual Studio管理控制台运行devenv.exe /installvstemplates ,以及devenv.exe /setup ,以获得良好的衡量标准。 After doing both several times, mixed with a few Visual Studio 2015 and Windows restarts, the project templates are still not showing up. 在多次执行此操作后,与少量Visual Studio 2015和Windows重新启动混合,项目模板仍未显示。

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. 我还试图通过删除C:\\Users\\<user>\\AppData\\Roaming\\Microsoft\\VisualStudioC:\\Users\\<user>\\AppData\\Local\\Microsoft\\VisualStudio\\14.0来清除缓存,但无济于事。

The MonoGame installer was customized to work with Visual Studio 2015, so I assume it should work somehow. MonoGame安装程序是自定义的,可以与Visual Studio 2015一起使用,所以我认为它应该以某种方式工作。

So, can anyone help me getting those project templates set up? 那么,任何人都可以帮助我设置这些项目模板吗?

I found out why it wasn't working: 我发现了为什么它不起作用:

Apparently, the MonoGame installer puts the Templates in the wrong folder for Visual Studio 2015. 显然,MonoGame安装程序将模板放在Visual Studio 2015的错误文件夹中。

The correct folder for VS2015 is VS2015的正确文件夹是

C:\\Users\\user\\Documents\\ Visual Studio 14 \\Templates\\ProjectTemplates\\Visual C# 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# MonoGame安装程序安装到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. 因此,当该文件夹中的MonoGame文件夹移动到第一个文件夹,并执行devenv.exe /installvstemplates命令时,模板就会显示出来。

In case you work as standard user and run MonoGame setup as admin, MonoGane templates was installed only in Administrator account. 如果您以标准用户身份运行并以管理员身份运行MonoGame设置,则仅在管理员帐户中安装MonoGane模板。

So I just make copy into my user \\ProjectTemplates\\Visual C# . 所以我只是复制到我的用户\\ProjectTemplates\\Visual C#

MonoGame Setup installation: MonoGame安装程序安装:

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. 然后如上所述,只需从VS2015的Developer Command Prompt运行devenv.exe /installvstemplates

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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