0

I'm working on a project which requires us to remotely build on some Raspberry Pis. We're using Visual Studio 2017, which has introduced some limitations. I've managed to create two Visual Studio templates, one that can be built on Windows and one which can be remotely built on the Pis.

Every time someone uses my templates, however, they need to create both templates and do a bunch of drag-and-dropping around and then they need to do some configuration themselves (which is a problem with simply using templates).

I'd like to build a simple ".bat" script (or possibly a small C# program if I really have to) that would create both templates and add the needed configurations automatically. Especially since every modification I do to the templates forces everyone to generate both ".vcxproj" files again.

I've found a couple of posts about building through the command line, and a StackOverflow post from 2011 about creating a whole solution from the command line (which Visual Studio couldn't do at the time, but its been 6+ years so that might have changed). I just need to generate the ".vcxproj" files from the templates, nothing fancier. Is that possible through the command line?

micka190
  • 742
  • 2
  • 8
  • 20

1 Answers1

0

Even if you did create scripts to create xml files from command line, you are doing something that can be accomplished in a better and much easier way with new features from the Visual Studio 2017 SDK. Also, Visual Studio 2017 does not scan directories for project templates anymore. (but this is ok, because there was no built-in versioning for vstemplates, and you will be using VSIX files for versioning)

Now you must use VSIX extensions to manage your templates. Continue to export your project templates as you are used to doing, but this time you will "import" the templates into a VSIX.

Importing a vspackage template

See this link on MSDN: Creating a VSIX for project templates

You may then optionally "import" the VSIX into an MSI for group policy deployment, or distribute the VSIX files by e-mail.

Here is a link from Mummy: Redistributing a VSIX package via Wix Installer

After this you can start looking at batch files for further optimization, such as redistributing .vcxproj.user files so users don't have to type in remote debugging parameters for Windows Iot

Whyan
  • 134
  • 1
  • 6
  • This is a ok answer, however, it does not work with .Net Core project. In that case you need to populate the template manually (Like projectgen which require some stuff from https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/cc175908(v=vs.90) ) – Nordes Oct 02 '18 at 12:58