VS2015 Update 3, MG templates broken [+fix]

Hi all,

I just updated my VS2015 Community to Update 3, then installed MG 3.5.1. Creating a new Windows 10 UWP project will fail with this error:

Initially I posted a solution but it was not correct so removed. Anyone knows how to get around this?

Out of curiosity, I searched Google and found this page:

You’ll see people reporting the same problem in the comments as recently as 3 days ago (search the page for “.wizard”). They’re not even using MonoGame AFAICT.

Commenter “Er Naparan” says he fixed the problem with these steps:

  1. Open “Programs and Features” on the “Control Panel”.
  2. Find “Microsoft Visual Studio 2015 with Updates” and uninstall it.
  3. Once uninstalled, restart your computer.
  4. Start installing Visual Studio by going to Visual Studio Downloads on the MSDN website, and then selecting the edition you want to download.
  5. Run the setup.
  6. Choose the “Custom” installation.
  7. Once the list of features appear, mark the “Universal Windows App Development Tools” component and start the installation.

Hopefully you are not “Er Naparan” and those steps work for you.

Thanks for the info Chuck. I have no issues creating new regular UWP projects, it is only the MG Windows 10 UWP template that bonks out with this error. My VS update is the final release and not RC as discussed on that page. I’m also very hesitant to uninstall VS as it takes hours to reinstall and I’m not sure it will even help. I did modify Universal Windows App Development Tools via the VS installer Modify option before posting here but that made no difference.

But I think I got it working this way:

  1. Locate MonoGame templates folder, copy and unzip WindowsUniversal.zip to a suitable folder, open this folder and edit WindowsUniversal.vstemplate and delete everything between </ TemplateContent> and </ VSTemplate> tags at the end of the file.

  2. Change text under < Name> tag to something that can be distinguished from the original MG UWP template in VS2015 New project dialog, e.g. “MonoGame Win10 UWP Modded”. Save WindowsUniversal.vstemplate.

  3. Edit project.json, change “Microsoft.NETCore.UniversalWindowsPlatform” from “5.0.0” to “5.1.0”. Save.

  4. Zip up all contents in the current folder to WindowsUniversalModded.zip. Copy the zip file to MonoGame templates folder.

  5. In VS2015, create new project and select the modded template.

  6. Before compiling first time a certificate has to be set or the compile will fail with C00CE169 Validation error. In VS Solution explorer double-click Package.appxmanifest, navigate to Packaging tab and click “Choose certificate” button.

I tried to attach my modded template zip file but unfortunately only images are accepted. So I’ve shared it via FileBin, if it helps anyone: http://filebin.ca/2mmU5HtKw2SZ/WindowsUniversalModded.zip

This template compiles for me out of the box after doing step 6 above. Resulting executable tested and runs on both Win 10 PC and phone. Finally I can move forward with porting my XNA game.

1 Like

To fix this all I did was open the template inside the templates folder with explorer; that is the zipped WindowsUniversal.zip file.

Edited the WindowsUniversal.vstemplate file in Notepad [This can be tricky so set it [Notepad] as your default using an extracted copy and then try to open the zipped version inside the zip template]

’
Microsoft.VisualStudio.WinRT.TemplateWizards, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Microsoft.VisualStudio.WinRT.TemplateWizards.ApplicationInsights.Wizard

’
Delete that part near the bottom, you could probably do a Find with this exact phrase… if the token is the same… I made no other changes at all to the zip file contents [The file opens in notepad with everything running as a single line so will look a little messy].

Notice I included the trailing 4 spaces in that snippet. and for some reason the preview was showing the beginning ’ and < on separate lines but there are no spaces at the beginning of my snippet, and then just save it on closing the file.

Went to create a new project…

And viola, no more error message… project created successfully and compiled and ran. both debug and release.

Additional data: Windows 10AE Fully Updated, VS 2015 U3.


For those of you whom like a back story [As I do :slight_smile: ]

I followed both mentioned methods above and neither worked…

However thanks to the contribution by parsec I was able to identify the precise issue at hand, following his/her method lead to no template option being shown… which is I presume due to the lack of whitespace, or that the zip required some other form of packaging? [Just a theory] Anyway I figured why not just isolate a particular part and it worked, somehow my subconscious decided to just edit the .vstemplate inside the zip file, kind of like IVF treatments no? haha.

Anyway I just felt I should contribute this method back to help others too.

Time to get coding!

Hope this helped,

Valentine

1 Like

I just did a fresh install of VS2015CE and MonoGame 3.5.1 and had the RT issue, used my above method this time allowing VS to open the .vstemplate file and just did as before and removed the reference.

EDIT

OK! Found the actual issue, the WinRT token is included twice… did not notice this in word-wrap on notepad but I saw it in VS. so just remove one of the references.

/EDIT

Works like a charm.