Blog - ASP.NET

Swimburger
.NET Bot holding a letter

Capture emails during development using smtp4dev and UI Test with Selenium

- .NET
You can use smtp4dev during development to prevent emails from going out to real customers. This tool also supports IMAP which you can use to query emails for automated testing.
.NET Bot holding a package with "ZIP" on it.

Create ZIP files on HTTP request without intermediate files using ASP.NET MVC Framework

- .NET
The ZipArchive wraps any stream to read, create, and update ZIP archives. You can send the result to the client using ASP.NET MVC Framework.
Blazor logo pointing to the GitHub logo pointing to the DigitalOcean logo

How to deploy Blazor WebAssembly to DigitalOcean App Platform

- .NET
Blazor WebAssembly can be served as static files. These files can be hosted in static hosting services such as DigitalOcean App Platform.
.NET Bot dressed up as a doctor

Don't use HttpContext.Current, especially when using async

- .NET
Avoid using HttpContext.Current if possible, especially in asynchronous code. Use the properties provided on the Page or Controller instead and pass them on to the asynchronous code.
.NET Bot holding a package with "ZIP" on it.

Create ZIP files on HTTP request without intermediate files using ASP.NET Core MVC, Razor Pages, and endpoints

- .NET
The ZipArchive wraps any stream to read, create, and update ZIP archives. You can send the result to the client using ASP.NET MVC, Razor Pages, and endpoints.
Blazor logo pointing to the GitHub logo pointing to the Cloudflare Pages logo

How to deploy Blazor WebAssembly to Cloudflare Pages

- .NET
Blazor WebAssembly can be served as static files. These files can be hosted in static hosting services such as Cloudflare Pages.
Heroku and Blazor logo

How to deploy Blazor WebAssembly to Heroku

- .NET
Heroku doesn't officially offer a static hosting service but does have an experimental 'buildpack' which gives you static hosting capabilities you can use to deploy and host Blazor WebAssembly.
Blazor logo pointing to the GitHub logo pointing to the AWS Amplify logo.

How to deploy Blazor WebAssembly to AWS Amplify

- .NET
Blazor WebAssembly can be served as static files. These files can be hosted in static hosting services such as AWS Amplify.
.NET Bot building an application

Use project Tye to host Blazor WASM and ASP.NET Web API on a single origin to avoid CORS

- .NET
Using Microsoft's experimental Project Tye, you configured the proxy to forward requests to '/api' to the Web API, and all other requests to the Blazor WASM client.
Blazor logo pointing to the GitHub logo and the GitHub logo pointing to the Netlify logo.

How to deploy Blazor WebAssembly to Netlify

- .NET
Now that you can run .NET web applications without server-side code, you can deploy these applications to various static site hosts, such as Netlify.
.NET Bot building an application

Use YARP to host client and API server on a single origin to avoid CORS

- .NET
Using Microsoft's new reverse proxy "YARP", you configured the proxy to forward requests to '/api' to the Web API, and all other requests to the Blazor WASM client.
 Blazor logo next to an arrow pointing to the GitHub logo next to a double arrow pointing from the GitHub logo to the Firebase Hosting logo

Video: How to deploy Blazor WebAssembly to Firebase Hosting

- .NET
With ASP.NET Blazor WebAssembly you can create .NET applications that run completely inside of the browser. The output of a Blazor WASM project are all static files. You can deploy these applications to various static site hosts like Firebase Hosting.
Blazor logo

Pre-render Blazor WebAssembly at build time to optimize for search engines

- .NET
Using pre-rendering tools like react-snap, you can pre-render Blazor WASM. Additionally, you can integrate these pre-rendering tools inside of your continuous integration and continuous deployment pipelines.
Blazor logo

Fix Blazor WebAssembly PWA integrity checks

- .NET
The service-worker-assets.js file is generated during publish and any modification made to the listed files after publish will cause the integrity check to fail.
 Blazor logo next to an arrow pointing to the GitHub logo next to a double arrow pointing from the GitHub logo to the Firebase Hosting logo

How to deploy Blazor WebAssembly to Firebase Hosting

- .NET
With ASP.NET Blazor WebAssembly you can create .NET applications that run completely inside of the browser. The output of a Blazor WASM project are all static files. You can deploy these applications to various static site hosts like Firebase Hosting.
Blazor and GitHub logo

Video: How to deploy ASP.NET Blazor WebAssembly to GitHub Pages

- .NET
With ASP.NET Blazor WebAssembly you can create .NET applications that run completely inside of the browser. The output of a Blazor WASM project are all static files. You can deploy these applications to various static site hosts like GitHub Pages.
Blazor next to JavaScript logo

Interacting with JavaScript Objects using the new IJSObjectReference in Blazor

- .NET
A new type is introduced in .NET 5 called IJSObjectReference. This type holds a reference to a JavaScript object and can be used to invoke functions available on that JavaScript object.
.NET Bot

Harden Anti-Forgery Tokens with IAntiforgeryAdditionalDataProvider in ASP.NET Core

- .NET
Using IAntiforgeryAdditionalDataProvider you can harden ASP.NET Core's anti-forgery token feature by adding additional data and validating the additional data.
Blazor and Twilio logo

Making Phone Calls from Blazor WebAssembly with Twilio Voice

- .NET
Using Twilio Voice you can add the ability to make and receive phone calls from your own ASP.NET web applications. Twilio’s helper library for JavaScript makes it easy to integrate client functionality into web front ends built with Blazor WebAssembly, and the Twilio NuGet packages provide you with convenient interfaces to Twilio’s APIs for server-side tasks.
Blazor logo next to JavaScript logo

Communicating between .NET and JavaScript in Blazor with in-browser samples

- .NET
The success of Blazor relies heavily upon how well it can integrate with the existing rich JavaScript ecosystem. The way Blazor allows you to integrate, is by enabling you to call JavaScript functions from Blazor and .NET functions from JavaScript also referred to as 'JavaScript interoperability'.