0

I'm writing a project template for Visual Studio.

In some of the files generated, I have a string which depends on visual studio version.

Can I get the visual studio version from the template file? I'd like to write

<MyCustomString>MyVariable.$visualstudioversion$</MyCustomString>

in the template which would expand to

<MyCustomString>MyVariable.14.0</MyCustomString>

in visual 2015 and

<MyCustomString>MyVariable.15.0</MyCustomString>

in visual 2017?

Any workaround would be acceptable.

Regis Portalez
  • 4,675
  • 1
  • 29
  • 41

1 Answers1

0

I just found out that the problem doesn't exist, since I can detect it directly from the vcxproj file, using

$(VisualStudioVersion)

which expands to 14.0 in visual 2015 and 15.0 in visual 2017.

Regis Portalez
  • 4,675
  • 1
  • 29
  • 41