# Getting Compile to work with Visual Studio 2017 Community Edition

The new Visual Studio is out since a week and I tried to get it to work with Mathematica (versions 11.0 and 11.1). However, the usual tricks for working with a new VS version fail here.

Related seems to be the remark made on Microsoft's MSDN blog:

Since we have removed the VS150COMNTOOLS registry key to support the new world where multiple VS instances of the same product can be installed side-by-side on the same machine, we know that many build systems and tools have relied on this in the past and the new options are not an identical replacement. We are actively working with library developers and others with builds that depend on the VC++ compiler tools, and we are open to further feedback to help refine and improve upon the solutions mentioned above. Please share any feedback you have in the comments or feel free to send more detailed suggestions to visualc@microsoft.com.

Anyone tried VS 2017 and succeeded in getting it to work with Compile?

• CCompilerDriver does not support VS2017. I think the changes in the new VS (as you mentioned) were drastic enough where there will be need to be changes from Mathematica's end to at least easily get them to work together. – user6014 Mar 15 '17 at 13:16
• @user6014 I'm not too sure of that. It looks like the changes concern only things as path finding/setting. That should be doable or are you aware of any other fundamental issues? – Sjoerd C. de Vries Mar 15 '17 at 13:20
• @Szabolcs I tried a few things but they didn't work. I guess installing an older VS version is the current workaround, but I don't like to have several massive installations in parallel. – Sjoerd C. de Vries Mar 15 '17 at 21:40
• Temporary workaround: To use a C++ compiler with Mathematica, it seems to be sufficient to install this (no GUI needed, safe to uncheck all components at installation). Take the 2015 version of course. It seems to coexist just fine with VS2017, so you can have it installed until Mathematica will work with VS2017. – Szabolcs Mar 22 '17 at 10:00
• A small correction: It is not safe to uncheck all components. If you do not already have a Windows SDK installed, do check this component during the installation of the build tools. In my case everything worked because I already had it installed. – Szabolcs Apr 3 '17 at 11:32

Since version 11.2.0, the CCompilerDriver package has been updated and supports Microsoft Visual Studio 2017.
As mentioned in the question, starting with VS2017 the VSXXXCOMNTOOLS registry keys or environment variables are no longer provided, so a new mechanism was needed so that the compiler installation can be detected. This is based on Microsoft's vswhere locator tool.