Skip to content

CodeDom.Compiler.CodeDomProvider.CreateProvider("JScript") does not return JavaScript provider #8796

Open
@radoslawbialek88

Description

@radoslawbialek88

Hi,
We are converting .Net4.8 tests to net6.0 and noticed following problem:
It is not possible to create javascript provider using:

System.CodeDom.Compiler.CodeDomProvider.CreateProvider("JScript");
Using "JS", "javascript", "jscript") does not work as well.

Error we get:
System.CodeDom.Compiler.CodeDomProvider+ConfigurationErrorsException
There is no CodeDom provider defined for the language.
at System.CodeDom.Compiler.CodeDomProvider.GetCompilerInfo(String language)
at System.CodeDom.Compiler.CodeDomProvider.CreateProvider(String language)

We can see that different version of System.CodeDom is used for Net48 and different for Net6:
image

There is no problem for Net48 and we can see after decompiling library that there is a method:

  this.AddCompilerInfo(new CompilerInfo(compilerParams3, codeDomProviderTypeName3)
  {
    _compilerLanguages = new string[3]
    {
      "js",
      "jscript",
      "javascript"
    },

but this is absent for version 6.0.0 and 7.0.0:
https://github.com/dotnet/runtime/blob/main/src/libraries/System.CodeDom/src/System/CodeDom/Compiler/CodeDomProvider.cs

According to: https://learn.microsoft.com/pl-pl/dotnet/api/system.codedom.compiler.codedomprovider?view=dotnet-plat-ext-7.0
This should work:
provider = CodeDomProvider.CreateProvider("JScript");

but it does not.
Can you please add provider for JavaScript?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.CodeDomdocumentationhelp wantedGood for community contributors to help [up-for-grabs]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions