Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

.NET Aspire: why doesn't WeatherApiClient.BaseAddress resolve correctly?

$
0
0

For the .NET Aspire Starter App, imagine that I extended the WeatherApiClient like this:

namespace AspireApp1.Web;public class WeatherApiClient(HttpClient httpClient){    public Uri? BaseAddress => httpClient.BaseAddress;    /* Other implementation... */}

And then I modified Home.razor to look like this:

@page "/"@inject WeatherApiClient MyWeatherApiClient<PageTitle>Home</PageTitle><h1>Hello, world!</h1>Welcome to your new app.<br />@MyWeatherApiClient.BaseAddress

Why doesn't @MyWeatherApiClient.BaseAddress get resolved correctly? And how can I make it resolve correctly?

enter image description here


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>