Relative Content

Tag Archive for c#blazor

HttpClient BaseAddress is sometimes null in Blazor project

I currently started a new project using Blazor and I am using auto rendermode globally. The structure by default has 2 projects: the server and the client project. I’ve created a simple login page in the client that uses a HttpClient to call an API from the server to login the user. The BaseAddress is set both in the server and client Program.cs:

HttpClient BaseAddress is sometimes null in Blazor project

I currently started a new project using Blazor and I am using auto rendermode globally. The structure by default has 2 projects: the server and the client project. I’ve created a simple login page in the client that uses a HttpClient to call an API from the server to login the user. The BaseAddress is set both in the server and client Program.cs:

HttpClient BaseAddress is sometimes null in Blazor project

I currently started a new project using Blazor and I am using auto rendermode globally. The structure by default has 2 projects: the server and the client project. I’ve created a simple login page in the client that uses a HttpClient to call an API from the server to login the user. The BaseAddress is set both in the server and client Program.cs:

GetAsync Call in Blazor WebAssembly Fails

I believe something which I don’t understand about Blazor coming from Windows form development is happening here. I am trying to get data from an API which I know is working correctly and delivering data correctly to another application. To me it appears that the code is being terminated prior to allowing the async call to finish.