Search Results for

    Show / Hide Table of Contents

    Compiling with Roslyn

    • 2021-09-28
    • Daniel Otykier
    Applies to:
    • ✔ Desktop Edition
    • ✔ Business Edition
    • ✔ Enterprise Edition

    If you prefer to compile your scripts using the new Roslyn compiler introduced with Visual Studio 2017, you can set this up under Tools > Preferences > Tabular Editor > C# SCripts and Maros. This allows you to use newer C# language features such as string interpolation. Simply specify the path to the directory that holds the compiler executable (csc.exe) and specify the language version as an option for the compiler:

    Custom Compiler Te3

    Visual Studio 2017

    For a typical Visual Studio 2017 Enterprise installation, the Roslyn compiler is located here:

    c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn
    

    This includes the C# 6.0 language features by default.

    image

    Visual Studio 2019

    For a typical Visual Studio 2019 Community installation, the Roslyn compiler is located here:

    c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn
    

    The compiler that ships with VS2019 supports C# 8.0 language features, which can be enabled by specifying the following as compiler options:

    -langversion:8.0
    
    • Improve this Doc
    In This Article
    Back to top Generated by DocFX