Skip to content

ArrayList.ToArray(type) is not working for enum type in Blazor WebAssembly

Notifications You must be signed in to change notification settings

jjzhang12/WasmToArrayIssue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WasmToArrayIssue

ArrayList.ToArray(type) is not working for enum type in Blazor WebAssembly

Below code is code snippet:

ArrayList list = new ArrayList(); list.Add(Day.Monday); var array = list.ToArray(typeof(Day));

public enum Day { Monday, Tuesday }

This is working fine in .net 6 desktop. But in Blazor WebAssembly, it throws exception System.InvalidCastException: At least one element in the source array could not be cast down to the destination array type.

About

ArrayList.ToArray(type) is not working for enum type in Blazor WebAssembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published