Skip to content

Commit 84027bd

Browse files
committed
Remove compiler config sections for types which cannot be instantiated
Fixes #7389
1 parent 66f19a9 commit 84027bd

1 file changed

Lines changed: 6 additions & 21 deletions

File tree

‎mcs/class/System/System.CodeDom.Compiler/CompilerCollection.cs‎

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace System.CodeDom.Compiler
3939
[ConfigurationCollection (typeof (Compiler), AddItemName = "compiler", CollectionType = ConfigurationElementCollectionType.BasicMap)]
4040
internal sealed class CompilerCollection : ConfigurationElementCollection
4141
{
42-
static readonly string defaultCompilerVersion = "3.5";
42+
static readonly string defaultCompilerVersion = "4.0";
4343
static ConfigurationPropertyCollection properties;
4444
static List <CompilerInfo> compiler_infos;
4545
static Dictionary <string, CompilerInfo> compiler_languages;
@@ -50,30 +50,15 @@ static CompilerCollection ()
5050
properties = new ConfigurationPropertyCollection ();
5151
compiler_infos = new List <CompilerInfo> ();
5252
compiler_languages = new Dictionary <string, CompilerInfo> (16, StringComparer.OrdinalIgnoreCase);
53-
compiler_extensions = new Dictionary <string, CompilerInfo> (6, StringComparer.OrdinalIgnoreCase);
53+
compiler_extensions = new Dictionary <string, CompilerInfo> (4, StringComparer.OrdinalIgnoreCase);
5454

55-
CompilerInfo compiler = new CompilerInfo (null, "Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
56-
new [] { ".cs" }, new [] { "c#", "cs", "csharp" });
55+
CompilerInfo compiler = new CompilerInfo (null, "Microsoft.CSharp.CSharpCodeProvider, " + Consts.AssemblySystem,
56+
new [] { "c#", "cs", "csharp" }, new [] { ".cs" });
5757
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
5858
AddCompilerInfo (compiler);
5959

60-
compiler = new CompilerInfo (null, "Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
61-
new [] { ".vb" }, new [] { "vb", "vbs", "visualbasic", "vbscript" });
62-
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
63-
AddCompilerInfo (compiler);
64-
65-
compiler = new CompilerInfo (null, "Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=8.0.1100.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
66-
new [] { ".js" }, new [] { "js", "jscript", "javascript" });
67-
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
68-
AddCompilerInfo (compiler);
69-
70-
compiler = new CompilerInfo (null, "Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
71-
new [] { ".jsl", ".java" }, new [] { "vj#", "vjs", "vjsharp" });
72-
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
73-
AddCompilerInfo (compiler);
74-
75-
compiler = new CompilerInfo (null, "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
76-
new [] { ".h" }, new [] { "c++", "mc", "cpp" });
60+
compiler = new CompilerInfo (null, "Microsoft.VisualBasic.VBCodeProvider, " + Consts.AssemblySystem,
61+
new [] { "vb", "vbs", "visualbasic", "vbscript" }, new [] { ".vb" });
7762
compiler.ProviderOptions ["CompilerVersion"] = defaultCompilerVersion;
7863
AddCompilerInfo (compiler);
7964
}

0 commit comments

Comments
 (0)