diff --git a/Client/Hosted.Client.csproj b/Client/Hosted.Client.csproj index da673fc..413e2d4 100644 --- a/Client/Hosted.Client.csproj +++ b/Client/Hosted.Client.csproj @@ -1,18 +1,17 @@ - + - netstandard2.0 + net6.0 Exe 7.3 - 3.0 - - - - - + + + + + diff --git a/Client/Program.cs b/Client/Program.cs index f45f5b9..5006767 100644 --- a/Client/Program.cs +++ b/Client/Program.cs @@ -1,16 +1,18 @@ -using Microsoft.AspNetCore.Blazor.Hosting; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; namespace Hosted.Client { public class Program { - public static void Main(string[] args) + public static async Task Main(string[] args) { - CreateHostBuilder(args).Build().Run(); + var builder = WebAssemblyHostBuilder.CreateDefault(args); + builder.Services.AddHttpClient("", client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)); + builder.RootComponents.Add("#app"); + await builder.Build().RunAsync(); } - - public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => - BlazorWebAssemblyHost.CreateDefaultBuilder() - .UseBlazorStartup(); } } diff --git a/Client/Startup.cs b/Client/Startup.cs index c4d4c81..174ee1a 100644 --- a/Client/Startup.cs +++ b/Client/Startup.cs @@ -1,4 +1,3 @@ -using Microsoft.AspNetCore.Components.Builder; using Microsoft.Extensions.DependencyInjection; namespace Hosted.Client @@ -8,10 +7,5 @@ public class Startup public void ConfigureServices(IServiceCollection services) { } - - public void Configure(IComponentsApplicationBuilder app) - { - app.AddComponent("app"); - } } } diff --git a/Client/_Imports.razor b/Client/_Imports.razor index bc53942..1b4b4a3 100644 --- a/Client/_Imports.razor +++ b/Client/_Imports.razor @@ -5,3 +5,4 @@ @using Microsoft.JSInterop @using Hosted.Client @using Hosted.Client.Shared +@using System.Net.Http.Json diff --git a/Client/wwwroot/css/site.css b/Client/wwwroot/css/site.css index fa2c7f1..56fc8ec 100644 --- a/Client/wwwroot/css/site.css +++ b/Client/wwwroot/css/site.css @@ -4,7 +4,7 @@ html, body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; } -app { +#app { position: relative; display: flex; flex-direction: column; @@ -103,7 +103,7 @@ app { } @media (min-width: 768px) { - app { + #app { flex-direction: row; } diff --git a/Client/wwwroot/index.html b/Client/wwwroot/index.html index e026ca2..e9cbf92 100644 --- a/Client/wwwroot/index.html +++ b/Client/wwwroot/index.html @@ -9,7 +9,7 @@ - Loading... +
Loading...
diff --git a/Server/Hosted.Server.csproj b/Server/Hosted.Server.csproj index 3518d81..6510213 100644 --- a/Server/Hosted.Server.csproj +++ b/Server/Hosted.Server.csproj @@ -1,15 +1,15 @@  - net5.0 + net6.0 7.3 - - - - + + + + diff --git a/Server/Startup.cs b/Server/Startup.cs index 627f122..d3b224a 100644 --- a/Server/Startup.cs +++ b/Server/Startup.cs @@ -18,33 +18,27 @@ public void ConfigureServices(IServiceCollection services) { options.SerializerSettings.TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto; }); - services.AddResponseCompression(opts => - { - opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat( - new[] { "application/octet-stream" }); - }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - app.UseResponseCompression(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - app.UseBlazorDebugging(); + app.UseWebAssemblyDebugging(); } app.UseStaticFiles(); - app.UseClientSideBlazorFiles(); + app.UseBlazorFrameworkFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); - endpoints.MapFallbackToClientSideBlazor("index.html"); + endpoints.MapFallbackToFile("index.html"); }); } } diff --git a/Shared/Hosted.Shared.csproj b/Shared/Hosted.Shared.csproj index 2a77f0c..33dd69e 100644 --- a/Shared/Hosted.Shared.csproj +++ b/Shared/Hosted.Shared.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 7.3