How to use/enable Roslyn compiler in Visual Studio build step
Hi,
I have a question about the use of Roslyn compiler.
I have a build step, type 'Visual Studio (sln)'. The project that is connected to this build step requires Roslyn.
Adding '/p:RoslynToolPath="C:\Program Files (x86)\MSBuild\14.0\Bin\amd64"' to the Command line parameters of the build step solves the problem I had.
But, I don't like to add this parameter to all Visual Studio build steps.
Is it possible that TeamCity uses Roslyn if needed by default? Then I don't have to add this parameter..
TeamCity version: 2018.1.5 (build 58744).
Thank you!
Please sign in to leave a comment.
Hi Martijn,
it's not possible to add the parameter to the Visual Studio (sln) runner, but you could create a meta runner or a build template and base your builds on those instead, that way you wouldn't need to replicate it every time.
So, it's required to always explicitly specify the Roslyn parameter for each Build step? You suggest me the build template, which was good suggestion, but I understand correctly it's not possible that the VS build step automatically applies Roslyn compiler when needed (based on project type) ?
Hi Martijn,
sorry for the delay, unfortunately I spent a few days out of the office and on the way back the answer got buried in hundred others and missed it.
Whether you require the parameter or not depends on your installation. Adding the parameter should guarantee that it works, but the Roslyn compiler is not included in .NET or VS installations by default. It was included in VS 2017 and the compiler was replaced with the Roslyn one.
That is, you will need to specify the parameter if you aren't using a version that automatically compiles it. We call the external tools installed on your system to run the compilation, so we cannot give a straight answer to that question.
Hope this helps, and again, sorry for the delay.