Skip to content

Commit 84c469f

Browse files
committed
Revert 2 fixes that build for .NET framework
1 parent 386ec50 commit 84c469f

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/libraries/Common/src/System/Resources/ResourceWriter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ private static ResourceTypeCode FindTypeCode(object? value, List<string> types)
488488
if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal))
489489
{
490490
typeName = typeName.Substring(17); // Remove through '.'
491+
#if NETCOREAPP
491492
ResourceTypeCode typeCode = Enum.Parse<ResourceTypeCode>(typeName);
493+
#else
494+
ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName);
495+
#endif
492496
return typeCode;
493497
}
494498
}

src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/ThrowHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument
2222

2323
private static string GetArgumentName(ExceptionArgument argument)
2424
{
25-
Debug.Assert(Enum.IsDefined(argument),
25+
Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
2626
"The enum value is not defined, please check the ExceptionArgument Enum.");
2727

2828
return argument.ToString();

src/tasks/AotCompilerTask/MonoAOTCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ private bool ProcessAndValidateArguments()
373373

374374
if (!Enum.TryParse(Mode, true, out parsedAotMode))
375375
{
376-
Log.LogError($"Unknown Mode value: {Mode}. '{nameof(Mode)}' must be one of: {string.Join(",", Enum.GetNames<MonoAotMode>())}");
376+
Log.LogError($"Unknown Mode value: {Mode}. '{nameof(Mode)}' must be one of: {string.Join(",", Enum.GetNames(typeof(MonoAotMode)))}");
377377
return false;
378378
}
379379

src/tasks/Microsoft.NET.WebAssembly.Webcil/WasmModuleReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private bool DoVisitSection(out bool shouldStop)
101101
shouldStop = false;
102102
byte code = _reader.ReadByte();
103103
Section section = (Section)code;
104-
if (!Enum.IsDefined(section))
104+
if (!Enum.IsDefined(typeof(Section), section))
105105
return false;
106106
uint sectionSize = ReadULEB128();
107107

src/tasks/WasmAppBuilder/EmccCompile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private bool ExecuteActual()
7575

7676
if (!Enum.TryParse(OutputMessageImportance, ignoreCase: true, out MessageImportance messageImportance))
7777
{
78-
Log.LogError($"Invalid value for OutputMessageImportance={OutputMessageImportance}. Valid values: {string.Join(", ", Enum.GetNames<MessageImportance>())}");
78+
Log.LogError($"Invalid value for OutputMessageImportance={OutputMessageImportance}. Valid values: {string.Join(", ", Enum.GetNames(typeof(MessageImportance)))}");
7979
return false;
8080
}
8181

0 commit comments

Comments
 (0)