diff --git a/src/ClientSideSample/ClientSideSample.csproj b/src/ClientSideSample/ClientSideSample.csproj index e5a309d..10546f3 100644 --- a/src/ClientSideSample/ClientSideSample.csproj +++ b/src/ClientSideSample/ClientSideSample.csproj @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/src/ClientSideSample/Program.cs b/src/ClientSideSample/Program.cs index fa658c4..8ffae27 100644 --- a/src/ClientSideSample/Program.cs +++ b/src/ClientSideSample/Program.cs @@ -3,6 +3,8 @@ using Microsoft.Extensions.DependencyInjection; using SampleCore; using System.Threading.Tasks; +using System.Net.Http; +using System; namespace ClientSideSample { @@ -15,7 +17,6 @@ public static async Task Main(string[] args) //Configure Services //AddBlazorStyled is needed for BlazorStyled to work - builder.Services.AddBaseAddressHttpClient(); builder.Services.AddBlazorStyled(isDevelopment: false, isDebug: false); //The following is only used by the sample sites and is not required for BlazorStyled to work @@ -25,7 +26,7 @@ public static async Task Main(string[] args) builder.RootComponents.Add("app"); - builder.Services.AddBaseAddressHttpClient(); + builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); await builder.Build().RunAsync(); } diff --git a/src/HostedSample/HostedSample.Server.csproj b/src/HostedSample/HostedSample.Server.csproj index 7d1f323..28f9ab5 100644 --- a/src/HostedSample/HostedSample.Server.csproj +++ b/src/HostedSample/HostedSample.Server.csproj @@ -6,7 +6,7 @@ - +