Monogame: Add support for Visual Studio 2017 templates

Created on 19 Nov 2016  ยท  45Comments  ยท  Source: MonoGame/MonoGame

Visual studio 2017 RC has been release ( https://www.visualstudio.com/vs/visual-studio-2017-rc/ ), and the current Monogame installer (3..6 dev) does not support installing the templates into the new version.

Loading an existing project into VS2017 does seem to work. Even existing Xamarin / mobile projects appear to be working. It's just the Monogame templates are missing for adding / creating new projects.

FYI, it appears as though the VS2017 installer comes with the options to install Unity out of the box. Would be pretty awesome to have Monogame as an option when installing VS2017.

Most helpful comment

Check this video for getting started with MonoGame on VS 2017
https://www.youtube.com/watch?v=zphaylhOrm0&t=25s

VS 2017 is fully supported in 3.6 (however, if you are using VS 2017 standalone, without VS2015 installed) then you need to grab the current dev release as there were some extra fixes needed. Don't ask why 2017 behaves differently with and without 2015 installed, it just does ๐Ÿ’ƒ

All 45 comments

Action for @dellis1972 and @CartBlanche to tackle trying to get MonoGame in to the VS2017 installer ๐Ÿ—ก
I've not installed the latest RC but can't see why the existing templates aren't showing up as previous versions are usually inherited. Will have to test on a clean machine.

We have to update the installer to copy the templates into the VS2017 ProjectTemplates folder.

If it hasn't already, I'll have a look at the build script and update.

OK, well that's problematic. The VS2017 RC doesn't register anything in the registry atm.
Will try installing fresh on another PC to see if it was my install.

However, copying the VS 2015 Project Templates to the 2017 folder does work and the templates work fine. May need a temporary solution for the RC and then update later.

In the past we haven't supported Release Candidates or Previews of Visual Studio in the MonoGame installer because things do change with the various releases until the final release.

As this is just templates, it should be ok. However, currently nothing I can do with it if the templates folder isn't registered anywhere

VS2017 uses a redirected registry for install with the new "Willow" installer and workload segmentation. Not sure what the best way is to get directory info but I can ask around.

Interesting @brianpeek let me know what you find out

Well, not great news...and I don't know how you'd accomplish it with NSIS...

Read more here.

Basically, the registry is virtualized to a file: %VsAppDataFolder%privateregistry.bin, and one can use RegLoadAppKey to read/write. I've looked at the Setup APIs and extensions for Visual Studio, but I don't see the Template directory info exposed anywhere.

I have questions out to the right folks in hopes of a better answer, but this is the current info I have...

Looks like we might have to go back to assuming the ProjectTemplates folder
is in the user's Documents folder.

I'll also be adding a separate tool that just installs the MonoGame
templates for the current user. This is for the users that do not have
admin rights because the installer runs as admin and therefore gets the
admin's Documents folder, not the user's Documents folder.

If a separate tool is written, you should be able to do the above and read the virtualized key. Not sure it's really worth all that effort, though...

Another option would be to build a proper VSIX for the template installation and launch the VSIX from the installer. Not sure NSIS supports this (never used it), but WiX does. That's really the proper solution for all versions of VS instead of reading the reg key...

Can we have another look at #4295? Maintaining all these templates for MonoDevelop and VS seperately is a pain.

Yo @BrianPeek any update on how we create VS2017 templates asย yet, or do we start looking towards the .NetCore / Nuget model?

@DDReaper If you mean how do we install them, the only proper way with VS2017 and forward is with a VSIX package, without resorting to some insane trickery for reading the virtualized registry, which I implore you all not to do. :)

I just installed VS2017 RC and put the templates from VS2015
into C:\Users\\Documents\Visual Studio
2017\Templates\ProjectTemplates\Visual C#\MonoGame and they work fine. So
we just need to update the installer to look for VS2017

On 19 February 2017 at 00:23, Brian Peek notifications@github.com wrote:

@DDReaper https://github.com/DDReaper If you mean how do we install
them, the only proper way with VS2017 and forward is with a VSIX package,
without resorting to some insane trickery for reading the virtualized
registry, which I implore you all not to do. :)

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/MonoGame/MonoGame/issues/5307#issuecomment-280885430,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAxeeWYELUeNLkBuqaiXjIbmRh01IaD1ks5rd4tugaJpZM4K3MG4
.

I'm doing some work on the installer now to separate current user installation (templates) from admin installation (core framework).

I believe that with VSIX we would have to create a separate VSIX for each supported version of Visual Studio? For those versions of Visual Studio that support VSIX anyway. We should start considering the retirement of VS2010.

The VSIX requirements also makes the separate project generator (#4295) a more attractive idea, though it loses the simplicity of selecting "New Project" in Visual Studio.

Yes, my preference would be the separate template generator, because then I could also use VS code instead of a Full VS and enable a better dev workflow for all platforms, not beholden to VS.

Although it will be a long day in hell before you rip VS from my cold dead fingers.

I just like more options to get developers on board and a separate template generator would help with that. But ensure we still have a VS vsix to launch the generator from a VS template (in the same way that Marmalade does)

I had a closer look through #4295, and it is a lot more complex than we need.

I have never used Marmalade. Do they have a separate project generator or is it a Visual Studio Project Wizard?

Yes, my preference would be the separate template generator, because then I could also use VS code instead of a Full VS and enable a better dev workflow for all platforms, not beholden to VS

I second that. Also there will soon be a new IDE, Rider, so I doubt we can maintain 3 sets of templates.

I had a closer look through #4295, and it is a lot more complex than we need.

Still missing PCL and Shared project support :| Also extremely limiting UI options.

You can check out the Marmalade Hub here - https://www.youtube.com/watch?v=MeOjQth4gmE
Their version of a project creation tool. Granted it is a bit "over the top".

The same front end is available from the "New Projects" list, which simply launches the hub. Basically the same as the Nsa ASP project wizard but it launches their New project creation hub.

You can check out the Marmalade Hub here - https://www.youtube.com/watch?v=MeOjQth4gmE
Their version of a project creation tool. Granted it is a bit "over the top".

@Jjagg and me have started working on our own tool that's pretty similar to that Hub, except it's for MonoGame, and it will have integrated content pipeline tool, custom editors and addons support.

Great news @cra0zy Any chance we can get visibility of that PR?

Although personally, something using Protobuild or the like to be able to generate the project would also be nice ๐Ÿ’ƒ But that might just be me.

Also checkout Yeoman http://yeoman.io/ - seems to be increasingly popular for constructing on the fly templates. I've been doing some VS Code stuff lately and they use it for their templates see https://code.visualstudio.com/docs/tools/yocode

Great news @cra0zy Any chance we can get visibility of that PR?

We started working on it a week ago so it's still bare bone and it's not a PR, but a separate repo, since neither of us thought anyone would want it in this repo. In a way it's pretty much a MonoGame IDE that we are trying to build.

something using Protobuild

I actually very much dislike Protobuild.

something using Protobuild
I actually very much dislike Protobuild.

I'll rephrase, something "like" protobuild that can generate not just a template for one project but a true multi-platform template.

I'll rephrase, something "like" protobuild that can generate not just a template for one project but a true multi-platform template.

The idea is pretty much the same as in that hub video, you just have a combobox that you switch to change the current platform. It will also use a PCL project as main code project.

or a shared project? :P (I don't do PCL unless its a pipeline extension ;) )

On 23 February 2017 at 16:20, Harry notifications@github.com wrote:

I'll rephrase, something "like" protobuild that can generate not just a
template for one project but a true multi-platform template.

The idea is pretty much the same as in that hub video, you just have a
combobox that you switch to change the current platform. It will also use a
PCL project as main code project.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/MonoGame/MonoGame/issues/5307#issuecomment-282040731,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAxeeUZ1ojUvXAFnUea5NkMp_MWu6YCYks5rfbG_gaJpZM4K3MG4
.

Or .Net Standard/Core lib ๐Ÿ“ฆ
whichever people want to use ๐Ÿ’ƒ

Unfortunately, the main project will have to be a PCL project (there are several reasons, too lazy to explain them all :P).

I'll buy that for a Dollar @cra0zy

Working now on .NET core is imo really important, so once CoreRT will be released it'll be easier to release games for iOS/Android/Consoles/WebAssemble without too much effort

I wouldn't waste my time on working for supporting a framework that will get deprecated in the near future :/

I'll buy that for a Dollar @cra0zy

Lol, that one sentence has so many meanings:

  • You don't believe me
  • You'll pay me a dollar to write down explanations
  • You'll believe me if I pay you a dollar
  • You would pay a dollar for an application like that
  • You find it amazing and fantastic

Well for your sanity @cra0zy I'm referring to
https://www.youtube.com/watch?v=85cL1HisrNc

Robocop Rules ๐Ÿ‘ฏ

Unfortunately, the main project will have to be a PCL project

For our 'MG IDE', yes. But we can allow users to use shared project/PCL/whatever if it's just the project generation.

Oh, I didn't see this conversation here...

@DDReaper

Yes, my preference would be the separate template generator, because then I could also use VS code instead of a Full VS and enable a better dev workflow for all platforms, not beholden to VS

Protobuild Manager is not specific to Visual Studio. If you're using VS Code and you want to create a template, you can just do Protobuild.exe --start <template name>.

@KonajuGames

The VSIX requirements also makes the separate project generator (#4295) a more attractive idea, though it loses the simplicity of selecting "New Project" in Visual Studio.

With #4295, it's exactly the same as you create new projects in VS now... Users just go New Project in Visual Studio, pick the MonoGame template to use, hit Create.

I had a closer look through #4295, and it is a lot more complex than we need.

Why is this? From MG's perspective, it's a lot simpler (no generator to maintain, just the template files and it works in every IDE).

@cra0zy

Still missing PCL and Shared project support :| Also extremely limiting UI options.

This is something that is pending.. but we have to get in merged before I'm going to spend time on that.

I also don't know what you mean by limiting UI options. You can extend it with as many options as you want to give the user by just setting up the template JSON.


The extensible Protobuild Manager supports everything everyone is asking for above, and MG doesn't have to maintain it. The work is done, and it's been tested in the wild and had a lot of use over the past 12 months.

If you're going to be discussing throwing away the work in #4295 and reimplementing it, could you at least ping me so I can counter any misconceptions about the PR as it stands?

@hach-que I think you misread @DDReaper comment, he was praising you for not being tied to a specific IDE :)

I just don't want to throw away the work done in #4295. It was like 2 months of work and it makes significant progress towards solving the problem that we have with templating.

I know it doesn't do everything yet, but half the people giving feedback are saying it does too much, and half the people are saying it doesn't do XYZ (yet). Let's get it rebased and merged in as a Step 1 and we can go from there, rather than having that PR get even larger and less manageable to review.

I also don't believe coming up with something custom for MonoGame is going to help with the maintenance burden for MonoGame developers. If you write something custom that isn't provided by a third-party, then that just more work that needs to be done by MG developers every time a new IDE/platform/what-have-you comes out. I'm already solving the exact same set of problems with Protobuild, so it seems silly to unnecessarily duplicate work.

I once used protobuild for an engine and it download too much stuff, it's hard to guess what it is doing, is it like the libGDX setup tool? because i think you guys should make something like libGDX

Protobuild doesn't download anything in an empty project...?

On Tue., 28 Feb. 2017, 3:01 am RUSshy, notifications@github.com wrote:

I once used protobuild for an engine and it download too much stuff, it's
hard to guess what it is doing, is it like the libGDX setup tool? because i
think you guys should make something like libGDX

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/MonoGame/MonoGame/issues/5307#issuecomment-282762558,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAez-oJ8eAexpLW1YlJO_9yx-ZdhrlXmks5rgvNegaJpZM4K3MG4
.

Is there any temporary fix that you could suggest? Thanks!

Check this video for getting started with MonoGame on VS 2017
https://www.youtube.com/watch?v=zphaylhOrm0&t=25s

VS 2017 is fully supported in 3.6 (however, if you are using VS 2017 standalone, without VS2015 installed) then you need to grab the current dev release as there were some extra fixes needed. Don't ask why 2017 behaves differently with and without 2015 installed, it just does ๐Ÿ’ƒ

That is why companies release Beta/RTM then RC to devs, so they can test their softwares for fixing compatibility issues in time for consumer release :p

Ahh but @RUSshy , if you follow this thread, we started investigations many months ago.
VS has CHANGED it's implementation right up to the Release Candidate and only recently were we able to use the current method to deploy the templates. They just didn't work before.

So best efforts were put in to test this PR and it's fix, but sadly one case was not tested and failed.

A lot of people put a lot of their own free time to contribute to this project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monsieurmax picture monsieurmax  ยท  5Comments

SenpaiSharp picture SenpaiSharp  ยท  3Comments

bjornenalfa picture bjornenalfa  ยท  5Comments

dazinator picture dazinator  ยท  5Comments

willmotil picture willmotil  ยท  5Comments