diff --git a/src/Compilers/CSharp/CscCore/project.json b/src/Compilers/CSharp/CscCore/project.json index 3850c64b15c2e201c747a08a26318f2c22211eb5..f1dff765afbe3996ce3c76d8d63296877068c5a5 100644 --- a/src/Compilers/CSharp/CscCore/project.json +++ b/src/Compilers/CSharp/CscCore/project.json @@ -25,6 +25,7 @@ "System.Runtime.Extensions": "4.0.10-beta-23109", "System.Runtime.Handles": "4.0.0-beta-23109", "System.Runtime.InteropServices": "4.0.20-beta-23109", + "System.Runtime.Loader": "4.0.0-beta-23109", "System.Runtime.Serialization.Json": "4.0.0-beta-23109", "System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-23109", "System.Security.Principal": "4.0.0-beta-23109", diff --git a/src/Compilers/Core/Portable/EncodedStringText.cs b/src/Compilers/Core/Portable/EncodedStringText.cs index 90179c8f7d65402566d4ce9e0ff835f8b5ad3454..bc4c4c485178c1acf3df534a87d67575dfb2e244 100644 --- a/src/Compilers/Core/Portable/EncodedStringText.cs +++ b/src/Compilers/Core/Portable/EncodedStringText.cs @@ -30,19 +30,19 @@ private static Encoding GetFallbackEncoding() { try { - // If we're running on CoreCLR there is no "default" codepage - // but we should be able to grab 1252 from System.Text.Encoding.CodePages if (CoreClrShim.IsCoreClr) { + // If we're running on CoreCLR there is no "default" codepage but + // we should be able to grab 1252 from System.Text.Encoding.CodePages CoreClrShim.Encoding.RegisterProvider(CoreClrShim.CodePagesEncodingProvider.Instance); // We should now have 1252 from the CodePagesEncodingProvider return PortableShim.Encoding.GetEncoding(1252); } - // If we're running on the desktop framework we should be able - // to get the default ANSI code page in the operating system's - // regional and language settings, else { + // If we're running on the desktop framework we should be able + // to get the default ANSI code page in the operating system's + // regional and language settings, return PortableShim.Encoding.GetEncoding(0) ?? PortableShim.Encoding.GetEncoding(1252); } diff --git a/src/Compilers/Helpers/CoreClrShim.cs b/src/Compilers/Helpers/CoreClrShim.cs index 379e1a9f0a49047d17bab0b7bd0e4f74013d1609..b1be31233644e3b009004c24ab4740ca4c35cb73 100644 --- a/src/Compilers/Helpers/CoreClrShim.cs +++ b/src/Compilers/Helpers/CoreClrShim.cs @@ -15,7 +15,7 @@ namespace Roslyn.Utilities internal static class CoreClrShim { internal static bool IsCoreClr { get; } = - Type.GetType("System.Runtime.Loader.AssemblyLoadContext, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", + Type.GetType("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false) != null; internal static void Initialize() diff --git a/src/Compilers/VisualBasic/VbcCore/project.json b/src/Compilers/VisualBasic/VbcCore/project.json index 3850c64b15c2e201c747a08a26318f2c22211eb5..f1dff765afbe3996ce3c76d8d63296877068c5a5 100644 --- a/src/Compilers/VisualBasic/VbcCore/project.json +++ b/src/Compilers/VisualBasic/VbcCore/project.json @@ -25,6 +25,7 @@ "System.Runtime.Extensions": "4.0.10-beta-23109", "System.Runtime.Handles": "4.0.0-beta-23109", "System.Runtime.InteropServices": "4.0.20-beta-23109", + "System.Runtime.Loader": "4.0.0-beta-23109", "System.Runtime.Serialization.Json": "4.0.0-beta-23109", "System.Security.Cryptography.Hashing.Algorithms": "4.0.0-beta-23109", "System.Security.Principal": "4.0.0-beta-23109",