Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change hardcoded usage of Microsoft.CSharp.CSharpProvider to instantiate it using CodeDomProvider.CreateProvider #736

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

burningice2866
Copy link
Contributor

Change hardcoded usage of Microsoft.CSharp.CSharpProvider to instantiate it using CodeDomProvider.CreateProvider

This gives the flexibility to configure dynamic compilation via app/web.config, ie. using Roslyn for newer C# features.

Implements feature #735

…ate it using CodeDomProvider.CreateProvider. This gives the flexibility to configure dynamic compilation via app/web.config, ie. using Roslyn for newer C# features.

Implements feature Orckestra#735
@VolodymyrMuzyka
Copy link

@napernik it will be included in next release? Now in order to upgrade, we have to comment reference to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider

@burningice2866
Copy link
Contributor Author

@napernik it will be included in next release? Now in order to upgrade, we have to comment reference to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider

The change gives the flexibility for C1 to use the provider defined in web.config when compiling code, so it's optional to use Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider or keep using the Orchestra provider currently used by asp.net.

Basically this how it always should have been from the beginning, then it wouldn't have been an issue.

@burningice2866
Copy link
Contributor Author

burningice2866 commented May 15, 2020

@aeont

  • before: var csCompiler = new CSharpCodeProvider()
  • now: var csCompiler = (CSharpCodeProvider)CodeDomProvider.CreateProvider("c#")

Whats the big deal, they are both of type CSharpCodeProvider ?? While before, it was 100% tied to the compiler builtin and shipped with .Net Full Framework, now we can make our own compiler which inherits from CSharpCodeProvider, register it in web.config and magically C1 will use that for its compiling.

@burningice2866
Copy link
Contributor Author

Can we soon get this merged so its possible to test it "in the field" on builds based of the dev-branch?

@napernik napernik merged commit 8668c64 into Orckestra:dev Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants