Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 1 release now available

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Blazor WebAssembly 3.2.0 Preview 1 release now available


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: devblogs.microsoft.com

Today we released a new preview update for Blazor WebAssembly with a bunch of great new features and improvements.

Hereโ€™s whatโ€™s new in this release:

  • Version updated to 3.2
  • Simplified startup
  • Download size improvements
  • Support for .NET SignalR client

Get started

To get started with Blazor WebAssembly 3.2.0 Preview 1 install the .NET Core 3.1 SDK and then run the following command:

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.2.0-preview1.20073.1

Thatโ€™s it! You can find additional docs and samples on https://blazor.net.

Upgrade an existing project

To upgrade an existing Blazor WebAssembly app from 3.1.0 Preview 4 to 3.2.0 Preview 1:

  • Update all Microsoft.AspNetCore.Blazor.* package references to 3.2.0-preview1.20073.1.
  • In Program.cs in the Blazor WebAssembly client project replace BlazorWebAssemblyHost.CreateDefaultBuilder() with WebAssemblyHostBuilder.CreateDefault().
  • Move the root component registrations in the Blazor WebAssembly client project from Startup.Configure to Program.cs by calling builder.RootComponents.Add<TComponent>(string selector).
  • Move the configured services in the Blazor WebAssembly client project from Startup.ConfigureServices to Program.cs by adding services to the builder.Services collection.
  • Remove Startup.cs from the Blazor WebAssembly client project.
  • If youโ€™re hosting Blazor WebAssembly with ASP.NET Core, in your Server project replace the call to app.UseClientSideBlazorFiles<Client.Startup>(...) with app.UseClientSideBlazorFiles<Client.Program>(...).

Version updated to 3.2

In this release we updated the versions of the Blazor WebAssembly packages to 3.2 to distinguish them from the recent .NET Core 3.1 Long Term Support (LTS) release. There is no corresponding .NET Core 3.2 release โ€“ the new 3.2 version applies only to Blazor WebAssembly. Blazor WebAssembly is currently based on .NET Core 3.1, but it doesnโ€™t inherit the .NET Core 3.1 LTS status. Instead, the initial release of Blazor WebAssembly scheduled for May of this year will be a Current release, which โ€œare supported for three months after a subsequent Current or LTS releaseโ€ as described in the .NET Core support policy. The next planned release for Blazor WebAssembly after the 3.2 release in May will be with .NET 5. This means that once .NET 5 ships youโ€™ll need to update your Blazor WebAssembly apps to .NET 5 to stay in support.

Simplified startup

Weโ€™ve simplified the startup and hosting APIs for Blazor WebAssembly in this release. Originally the startup and hosting APIs for Blazor WebAssembly were designed to mirror the patterns used by ASP.NET Core, but not all of the concepts were relevant. The updated APIs also enable some new scenarios.

Hereโ€™s what the new startup code in Program.cs looks like:

public class Program
{
    public static async Task Main(string[] args)
    {
        var builder = WebAssemblyHostBuilder.CreateDefault(args);
        builder.RootComponents.Add<App>("app");

        await builder.Build().RunAsync();
    }
}

Blazor WebAssembly apps now support async Main methods for the app entry point.

To a create a default host builder, call WebAssemblyHostBuilder.CreateDefault(). Root components and services are configured using the builder; a separate Startup class is no longer needed.

The following example adds a WeatherService so itโ€™s available through dependency injection (DI):

public class Program
{
    public static async Task Main(string[] args)
    {
        var builder = WebAssemblyHostBuilder.CreateDefault(args);
        builder.Services.AddSingleton<WeatherService>();
        builder.RootComponents.Add<App>("app");

        await builder.Build().RunAsync();
    }
}

Once the host is built, you can access services from the root DI scope before any components have been rendered. This can be useful if you need to run some initialization logic before anything is rendered:

public class Program
{
    public static async Task Main(string[] args)
    {
        var builder = WebAssemblyHostBuilder.CreateDefault(args);
        builder.Services.AddSingleton<WeatherService>();
        builder.RootComponents.Add<App>("app");

        var host = builder.Build();

        var weatherService = host.Services.GetRequiredService<WeatherService>();
        await weatherService.InitializeWeatherAsync();

        await host.RunAsync();
    }
}

The host also now provides a central configuration instance for the app. The configuration isnโ€™t populated with any data by default, but you can populate it as required in your app.

public class Program
{
    public static async Task Main(string[] args)
    {
        var builder = WebAssemblyHostBuilder.CreateDefault(args);
        builder.Services.AddSingleton<WeatherService>();
        builder.RootComponents.Add<App>("app");

        var host = builder.Build();

        var weatherService = host.Services.GetRequiredService<WeatherService>();
        await weatherService.InitializeWeatherAsync(host.Configuration["WeatherServiceUrl"]);

        await host.RunAsync();
    }
}

Download size improvements

Blazor WebAssembly apps run the .NET IL linker on every build to trim unused code from the app. In previous releases only the core framework libraries were trimmed. Starting with this release the Blazor framework assemblies are trimmed as well resulting in a modest size reduction of about 100 KB transferred. As before, if you ever need to turn off linking, add the <BlazorLinkOnBuild>false</BlazorLinkOnBuild> property to your project file.

Support for the .NET SignalR client

You can now use SignalR from your Blazor WebAssembly apps using the .NET SignalR client.

To give SignalR a try from your Blazor WebAssembly app:

  1. Create an ASP.NET Core hosted Blazor WebAssembly app.

    dotnet new blazorwasm -ho -o BlazorSignalRApp
    
  2. Add the ASP.NET Core SignalR Client package to the Client project.

    cd BlazorSignalRApp
    dotnet add Client package Microsoft.AspNetCore.SignalR.Client
    
  3. In the Server project, add the following Hub/ChatHub.cs class.

    using System.Threading.Tasks;
    using Microsoft.AspNetCore.SignalR;
    
    namespace BlazorSignalRApp.Server.Hubs
    {
        public class ChatHub : Hub
        {
            public async Task SendMessage(string user, string message)
            {
                await Clients.All.SendAsync("ReceiveMessage", user, message);
            }
        }
    }
    
  4. In the Server project, add the SignalR services in the Startup.ConfigureServices method.

    services.AddSignalR();
    
  5. Also add an endpoint for the ChatHub in Startup.Configure.

    .UseEndpoints(endpoints =>
    {
        endpoints.MapDefaultControllerRoute();
        endpoints.MapHub<ChatHub>("/chatHub");
        endpoints.MapFallbackToClientSideBlazor<Client.Program>("index.html");
    });
    
  6. Update Pages/Index.razor in the Client project with the following markup.

    @using Microsoft.AspNetCore.SignalR.Client
    @page "/"
    @inject NavigationManager NavigationManager
    
    <div>
        <label for="userInput">User:</label>
        <input id="userInput" @bind="userInput" />
    </div>
    <div class="form-group">
        <label for="messageInput">Message:</label>
        <input id="messageInput" @bind="messageInput" />
    </div>
    <button @onclick="Send" disabled="@(!IsConnected)">Send Message</button>
    
    <hr />
    
    <ul id="messagesList">
        @foreach (var message in messages)
        {
            <li>@message</li>
        }
    </ul>
    
    @code {
        HubConnection hubConnection;
        List<string> messages = new List<string>();
        string userInput;
        string messageInput;
    
        protected override async Task OnInitializedAsync()
        {
            hubConnection = new HubConnectionBuilder()
                .WithUrl(NavigationManager.ToAbsoluteUri("/chatHub"))
                .Build();
    
            hubConnection.On<string, string>("ReceiveMessage", (user, message) =>
            {
                var encodedMsg = user + " says " + message;
                messages.Add(encodedMsg);
                StateHasChanged();
            });
    
            await hubConnection.StartAsync();
        }
    
        Task Send() => hubConnection.SendAsync("SendMessage", userInput, messageInput);
    
        public bool IsConnected => hubConnection.State == HubConnectionState.Connected;
    }
    
  7. Build and run the Server project

    cd Server
    dotnet run
    
  8. Open the app in two separate browser tabs to chat in real time over SignalR.

Known issues

Below is the list of known issues with this release that will get addressed in a future update.

  • Running a new ASP.NET Core hosted Blazor WebAssembly app from the command-line results in the warning: CSC : warning CS8034: Unable to load Analyzer assembly C:Usersuser.nugetpackagesmicrosoft.aspnetcore.components.analyzers3.1.0analyzersdotnetcsMicrosoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded.

    • Workaround: This warning can be ignored or suppressed using the <DisableImplicitComponentsAnalyzers>true</DisableImplicitComponentsAnalyzers> MSBuild property.

Feedback

We hope you enjoy the new features in this preview release of Blazor WebAssembly! Please let us know what you think by filing issues on GitHub.

Thanks for trying out Blazor!

The post Blazor WebAssembly 3.2.0 Preview 1 release now available appeared first on ASP.NET Blog.

...



๐Ÿ“Œ Blazor 8 vereint Blazor Server und Blazor WebAssembly | heise online


๐Ÿ“ˆ 67.49 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 1 release now available


๐Ÿ“ˆ 54.95 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 2 release now available


๐Ÿ“ˆ 54.95 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 3 release now available


๐Ÿ“ˆ 54.95 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 4 release now available


๐Ÿ“ˆ 54.95 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Preview 5 release now available


๐Ÿ“ˆ 54.95 Punkte

๐Ÿ“Œ Blazor Server und Blazor WebAssembly: Alternativen zu JavaScript?


๐Ÿ“ˆ 49.74 Punkte

๐Ÿ“Œ Blazor WebAssembly vs. Blazor Server: Which One Should You Choose?


๐Ÿ“ˆ 49.74 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 Release Candidate now available


๐Ÿ“ˆ 48 Punkte

๐Ÿ“Œ Blazor WebAssembly 3.2.0 now available


๐Ÿ“ˆ 42.9 Punkte

๐Ÿ“Œ Blazor wird mobil: Microsoft stellt Mobile Blazor Bindings vor


๐Ÿ“ˆ 35.49 Punkte

๐Ÿ“Œ Blazor wird mobil: Microsoft stellt Mobile Blazor Bindings vor


๐Ÿ“ˆ 35.49 Punkte

๐Ÿ“Œ Welcome to Blazor | Focus on Blazor


๐Ÿ“ˆ 35.49 Punkte

๐Ÿ“Œ Blazor 0.7.0 experimental release now available


๐Ÿ“ˆ 33.74 Punkte

๐Ÿ“Œ BLAZOR: Modern Web Development with .NET and WebAssembly


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ WebAssembly and Blazor: Re-assembling the Web


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Microsoft Build 2020: Blazor WebAssembly ist fertig


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Modern Web UI with Blazor WebAssembly | BOD104


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Modern Web UI with Blazor WebAssembly | INT169A


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Learn Studio Session: Build a WebAssembly app with Blazor & VS Code | COM141


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Learn Studio Session: Build a WebAssembly app with Blazor & VS Code | COM144


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Learn Studio Session: Build a WebAssembly app with Blazor & VS Code | COM147


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ heise+ | Web-Entwicklung: Single-Page-Web-Apps mit Blazor WebAssembly


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Webprogrammierung mit Blazor WebAssembly, Teil 1: Web-API-Aufrufe und Rendering


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly, Teil 2: Eingabesteuerelemente & JavaScript-Interoperabilitรคt


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly, Teil 3: Authentifizierung und Autorisierung


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly, Teil 4: Zustandsverwaltung und Nachladen von Modulen


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly: Bidirektionale Kommunikation und Benachrichtigungen


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly: So nutzen Sie PWA-Schnittstellen in C#


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Top Languages for WebAssembly Development: Rust, C++, Blazor, Go - and JavaScript?


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Blazor WebAssembly: A Game-Changer for Progressive Web Apps


๐Ÿ“ˆ 32 Punkte

๐Ÿ“Œ Windows 10 19H2 preview now available for all Release Preview Insiders


๐Ÿ“ˆ 29.89 Punkte

๐Ÿ“Œ WebAssembly & NodeJS (Node 8 supports WebAssembly!)


๐Ÿ“ˆ 28.52 Punkte

๐Ÿ“Œ Analysis of Google Keep WebAssembly module - WebAssembly Security


๐Ÿ“ˆ 28.52 Punkte

๐Ÿ“Œ Analysis of Google Keep WebAssembly module - WebAssembly Security


๐Ÿ“ˆ 28.52 Punkte











matomo