Link to home
Start Free TrialLog in
Avatar of Phil Catterall
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:
string[] scopeDefault = new string[] { "myString" };

Open in new window

Debug:
User generated image
Now compare with Blazor Web Assembly:
Declaration (identical)
string[] scopeDefault = new string[] { "MyString" };

Open in new window

Debug:
User generated image
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
Avatar of Allan
Allan
Flag of United States of America image

Can you please give screen shots of your Blazor Client and Server code? And when you said
In WASM it breaks with "Children could not be evaluated"
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 TRIAL
Members 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.