Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Getting Started with Blazor Server Apps in Visual Studio for Mac

๐Ÿ  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



๐Ÿ“š Getting Started with Blazor Server Apps in Visual Studio for Mac


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

In Visual Studio 2019 for Mac v8.4 one of the big things that we added support for is developing Blazor Server Applications. In this post Iโ€™ll show you how you can get started building new Blazor Server applications with Visual Studio for Mac. Blazor lets you build interactive web UIs using C# instead of JavaScript. Blazor apps are composed of reusable web UI components implemented using C#, HTML, and CSS. Both client and server code are written in C#, allowing you to share code and libraries.

Creating a new Blazor Server Project

When you first launch Visual Studio for Mac you will see the dialog that follows:

To get started you will first click New to begin creating your new Blazor Server app. You can also use the menu option File->New Solution as shown below.

Once youโ€™ve done that, the New Project Dialog will appear. To create a Blazor Server app we will go to the .NET Core -> App section and then select Blazor Server App:

After clicking Next, youโ€™ll be prompted to select the .NET Core version. You can select the default value, .NET Core 3.1 at the time of this post, or change it to use a specific version. For Blazor apps, .NET Core 3.0 or newer is required. Once youโ€™ve selected Next, youโ€™ll get to the next page in the wizard where you will give your new project a name. I have named this new project HelloBlazor.

Now that we have configured our new project we can click Create (or hit the Return key) to create the project. After the project is created, it will be opened in the IDE. I have opened the Index.razor file in Visual Studio for Macโ€™s editor, which you can see in the screenshot below.

Now that the project has been created, the first thing that we should do is to run the application to ensure that everything is working as expected. You can start your new Blazor app with Run > Start Debugging or Run > Start without Debugging.

In this case, letโ€™s go with Start without Debugging because it launches faster than a debug session, and we are not intending to do any debugging currently. To Start without Debugging you can use the menu option (shown in image above), or you can use the keyboard shortcut โŒฅโŒ˜โŽ. When you start your application, it will be launched within the default system browser., You can change the launched browser by using the browser selector in the toolbar, shown in next image.

Letโ€™s start this app with the keyboard shortcut for Start without Debugging. After the project is built, the app will be opened in a browser. Now that we have our project up and running, letโ€™s have some fun and customize it a bit.

In the project that is created there is a Counter page where you can click a button to increment the count. Letโ€™s modify this to page to enable the user to specify the increment value. We can do this by adding an input field onto the Counter page and binding it to a new increment property that is used to increment the counter. Take a look at the updated code for Counter.razor in the following screenshot.

If you would like to copy and paste the code into your project, a snippet is below.

@page "/counter"

<h1>Counter</h1>

<input type="number" min="1" step="1" @bind-value="increment" />
<p>Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
    public int increment = 1;
    private int currentCount = 0;

    private void IncrementCount()
    {
        currentCount += increment;
    }
}

In the code shown above the lines indicated by an arrow are the new, or edited, lines of code. Here we have added a new input field (line 5) for users to configure the increment, we have added a new property increment (line 11) to store the increment value and lastly we have modified line 16 to use the increment value instead of the hard coded increment by 1.

To ensure that the changes we have made are working as expected, we will start a debugging session. Letโ€™s set a breakpoint when currentCount is incremented, line 16. After setting that breakpoint, we will Start Debugging with the keyboard shortcut โŒ˜โŽ. When the breakpoint is hit, we can verify that the value for increment is taken from the input field on the Counter page. The animated gif below shows; creating a breakpoint, debugging the application and inspecting the value for increment when the breakpoint is hit.

If all goes well, the increment value was taken from the input field in the Counter page, and the app is behaving correctly. Now that weโ€™ve shown how you can create, edit and debug a Blazor Server app, itโ€™s time to wrap up this post.

Recap and next steps

In this post we have shown how to create a new Blazor Server application and work with it in Visual Studio for Mac. If you havenโ€™t already, download Visual Studio for Mac to get started. If you are an existing Visual Studio for Mac user, update Visual Studio for Mac to version 8.4 or newer to get support for Blazor Server apps. In addition to developing Blazor Server apps, you can also publish them to Azure App Services.

If you have any issues while working in Visual Studio for Mac, please Report a Problem so that we can improve the product. Before we go, here are some additional resources for you.

Additional Resources

To learn more about the changes in Visual Studio 2019 for Mac v8.4, take a look at the v8.4 release blog post.

Join us for our upcoming Visual Studio for Mac: Refresh() event on February 24 for deep dive sessions into .NET development using Visual Studio for Mac, including a full session on developing Blazor applications.

For more info on Blazor a good starting point is Introduction to ASP.NET Core Blazor.

For another guide on creating a Blazor Server application in Visual Studio for Mac head over to the docs at Create Blazor web apps.

Make sure to follow us on Twitter at @VisualStudioMac and reach out to the team. Customer feedback is important to us and we would love to hear your thoughts. Alternatively, you can head over to Visual Studio Developer Community to track your issues, suggest a feature, ask questions, and find answers from others. We use your feedback to continue to improve Visual Studio 2019 for Mac, so thank you again on behalf of our entire team.

The post Getting Started with Blazor Server Apps in Visual Studio for Mac appeared first on Visual Studio Blog.

...



๐Ÿ“Œ Getting Started with Blazor Server Apps in Visual Studio for Mac


๐Ÿ“ˆ 63.9 Punkte

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


๐Ÿ“ˆ 56.64 Punkte

๐Ÿ“Œ Getting Started with Python in Visual Studio Code | Visual Studio Toolbox


๐Ÿ“ˆ 48.15 Punkte

๐Ÿ“Œ Getting Started with Python in Visual Studio Code | Visual Studio Toolbox


๐Ÿ“ˆ 48.15 Punkte

๐Ÿ“Œ Visual Studio for Mac + ASP.NET Core โ€“ Deploy eShopOnWeb to Azure using Visual Studio for Mac


๐Ÿ“ˆ 39.96 Punkte

๐Ÿ“Œ What is Visual Studio for Mac? [1 of 4] | Intro to Visual Studio for Mac


๐Ÿ“ˆ 39.96 Punkte

๐Ÿ“Œ Visual Studio for Mac .NET productivity [3 of 4] | Intro to Visual Studio for Mac


๐Ÿ“ˆ 39.96 Punkte

๐Ÿ“Œ Install Visual Studio for Mac and run C# Tutorial [2 of 4] | Intro to Visual Studio for Mac


๐Ÿ“ˆ 39.96 Punkte

๐Ÿ“Œ Visual Studio for Mac - How to Get Involved [4 of 4] | Intro to Visual Studio for Mac


๐Ÿ“ˆ 39.96 Punkte

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


๐Ÿ“ˆ 38.89 Punkte

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


๐Ÿ“ˆ 38.89 Punkte

๐Ÿ“Œ Visual Studio for Mac + ASP.NET Core โ€“ Getting started with ASP.NET Core using eShopOnWeb


๐Ÿ“ˆ 38.61 Punkte

๐Ÿ“Œ Visual Studio Toolbox Live - Getting the Most Out of Visual Studio


๐Ÿ“ˆ 37.66 Punkte

๐Ÿ“Œ Getting started with the Fluent UI Blazor library


๐Ÿ“ˆ 36.39 Punkte

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


๐Ÿ“ˆ 35.51 Punkte

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


๐Ÿ“ˆ 35.51 Punkte

๐Ÿ“Œ Welcome to Blazor | Focus on Blazor


๐Ÿ“ˆ 35.51 Punkte

๐Ÿ“Œ Kalenderwoche 42/2018 fรผr Entwickler im Rรผckblick: Visual Studio 2019, Visual Studio for Mac, .NET Core 2.2 und mehr


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio 2019 Launch: A tour of Visual Studio for Mac for .NET development


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio 2019 Launch: A tour of Visual Studio for Mac for .NET development


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio 2019 Launch: A tour of Visual Studio for Mac for .NET development


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio Toolbox Live - What's New in Visual Studio for Mac: Release Candidate!


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: New Editor | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: How to Report a Problem | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio Live! - Visual Studio for Mac


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio 2019 version 16.3 Preview 2 and Visual Studio for Mac version 8.3 Preview 2 Released!


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: Keyboard Shortcuts | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: Snippets | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Whatโ€™s New in Visual Studio for Mac 2019 | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: Improve your Debugging Experience with these Tips | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Visual Studio for Mac: Improved productivity for .NET Core developers | Visual Studio Toolbox


๐Ÿ“ˆ 34.74 Punkte

๐Ÿ“Œ Getting Started with Visual Studio 2019


๐Ÿ“ˆ 33.39 Punkte

๐Ÿ“Œ Getting Started with GitHub Actions in Visual Studio


๐Ÿ“ˆ 33.39 Punkte

๐Ÿ“Œ Getting Started with Python in Visual Studio Code


๐Ÿ“ˆ 33.39 Punkte

๐Ÿ“Œ Getting Started with Python in Visual Studio Code


๐Ÿ“ˆ 33.39 Punkte











matomo