I have a blazor wasm app that I developed on a Windows PC in Visual Studio 2022. I've recently been trying out a MacBook Air M1, with Visual Studio 2022 for Mac Installed.
I copied the VS solution across. It compiles and runs ok until it gets to the following line in the code-behind of a page component:
return await _httpClient.GetFromJsonAsync<IEnumerable<ClientOrg>>($"api/clients");
This should make a http request to a web api project of the same solution but instead, the following error is raised:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: '<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. System.Text.Json.JsonException: '<' is an invalid start of a value
The same code works when run on Windows.
Anyone see where I'm going wrong?