TypeInitializer Error from ServiceStack.HttpUtils

I am getting an error on the baseline ServiceStack Blazor WASM project, as follows:

I created the project using “x new blazor-wasm”, and then opened, built the project and debugged the application (from Visual Studio 2022). The error is occurring on the “todos” page - immediately upon loading.

If I navigate to https://localhost:5001/metadata I am able to successfully call the QueryTodos api with no issues:

There are no errors listed in the Console or the Visual Studio debug output that I can see…and if I try to add my own api, I get the same error.

Any ideas what could be happening?

Yeah the 6.0.2 update caused this issue in Blazor, it’s been fixed on 6.0.3 on MyGet.

Did you create this template a while ago as new templates should already come pre-configured to use the pre-release packages on MyGet?

If you don’t have NuGet.config, you can download it from:

Then do a fresh restore to fetch the 6.0.3 pre-release packages on MyGet.

updating to 6.0.3 worked - thanks Demis :slight_smile:
I think my version of the x utility may have been older, perhaps?

It shouldn’t matter as it should fetch the live project templates from GitHub. I just tested and seemed to pull down the latest template with NuGet.config.

I’m assuming it’s a caching issue, but it specifically avoids caching templates from master/main branches which blazor-wasm uses, so not sure what the issue could be.

If it is a caching issue you can run x clean to delete the download caches.

gotya - thank you for the speedy turnaround. As usual, you rock sir :slight_smile: