Skip to content

Support csc.exe path configuration via standard provider options in web.config/app.config #83

@cmlr72

Description

@cmlr72

The roslyn compiler path should be configurable via documented configuration settings instead of internal implementation details like environment variables.
The providerOption element under system.codedom/compilers/compiler is officially documented and also used by the integrated CodeDomProvider, e.g.

<system.codedom>
   <compilers>
    <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <providerOption name="CompilerVersion" value="v4.0"/>
      <providerOption name="WarnAsError" value="false"/>
     </compiler>
   </compilers>
</system.codedom>

So the RoslynCodeDomProvider should support something like

<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701">
   <providerOption name="CompilerPath" value="..\my\path\to\csc.exe"/>
</compiler>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions