Phil Catterall
asked on
Issue with Blazor Web Assembly string arrays
Hoping someone can help me here. A string Array seems to form differently in Blazor Web Assembly from Blazor Server. A String Array declaration in Blazor Server is as expected.
Declaration:
Now compare with Blazor Web Assembly:
Declaration (identical)
Note the difference in the construct of the array and the Server version does not have a length attribute. I'm using this in a function that requires an iEnumerable interface. When I try and use the string array in Blazor Server, it's fine. In WASM it breaks with "Children could not be evaluated". I've tried constructing a List and same issue.
Any clues anyone ?
Thanks
Phil
Declaration:
string[] scopeDefault = new string[] { "myString" };
Debug:Now compare with Blazor Web Assembly:
Declaration (identical)
string[] scopeDefault = new string[] { "MyString" };
Debug:Note the difference in the construct of the array and the Server version does not have a length attribute. I'm using this in a function that requires an iEnumerable interface. When I try and use the string array in Blazor Server, it's fine. In WASM it breaks with "Children could not be evaluated". I've tried constructing a List and same issue.
Any clues anyone ?
Thanks
Phil
Can you please give screen shots of your Blazor Client and Server code? And when you said
Do you mean in Debug mode? And are you debuggin in the very first page load of your Blazor Client?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.