Blog

Swimburger
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.
Social Media Logo's in front of arrows

Don't forget to provide image alt meta data for open graph and twitter cards social sharing

- Web
Due to the lack of support historically and it not being prominent in many samples, the important alternative text meta tag is often forgotten. To add support for the alt-meta tag use og:image:alt and twitter:image:alt.
.NET logo

Rethrowing your exceptions wrong in .NET could erase your stacktrace

- .NET
You may be erasing your stacktrace if you are catching and rethrowing exceptions the wrong way. This could make debugging a nightmare because you don't know where the exception was originally thrown.
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.
Screenshot of metatags.io preview

Verify what your webpage looks like in Google, Facebook, Twitter, LinkedIn, and more

- Web
Social media platforms each generate link previews/cards differently. You can use the official debuggers/inspectors provided by Facebook, Twitter, LinkedIn to debug the previews. To quickly preview multiple social networks + Google + Slack, you can use metatags.io.
Azure Application Insights logo

Querying top requested URL's using Kusto and Log Analytics in Azure Application Insights

- Azure
One query many webmasters and content editors are interested in is which URL's are most popular. Azure Application Insights can answer this question with data coming from back-end telemetry and can include request telemetry of static files as well.
PowerShell logo

ConvertFrom-SecureString : A parameter cannot be found that matches parameter name 'AsPlainText'

- PowerShell
If you're using older versions of PowerShell, you do not have the 'AsPlainText' flag available to you. You're not out of luck though, you can quickly create your own function which will give you the same result.
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'.
Azure Application Insights logo

Querying 404's using Kusto and Log Analytics in Azure Application Insights

- Azure
Using the built-in Log Analytics workspace in Azure Application Insights, you can query all the URL's causing 404 HTTP Status responses.
.NET Bot writing on a whiteboard

Configure CORS using AppSettings or Custom Configuration Sections in ASP.NET Web API

- .NET
Microsoft's CORS library works, but the attributes force you to hardcode the CORS headers. By creating custom CORS attributes, you can read the CORS configuration from AppSettings or a custom config section.
.NET Logo

Configure ServicePointManager.SecurityProtocol through AppSettings

- .NET
Usually .NET automatically finds a security protocol in common, but sometimes you have to update ServicePointManager.SecurityProtocol explicitly.
Blazor and Firebase logo

Real-time applications with Blazor Server and Firestore

- DotNet
Blazor Server is built on SignalR, which is built on websockets. Among things, websockets enable Blazor Server to push changes from the server to the browser at any time. You can build real-time UI's when you combine this with a real-time database.
Blazor logo

Pushing UI changes from Blazor Server to browser on server raised events

- .NET
Blazor Server is built on SignalR, and SignalR is built on websockets among other techniques. The combination of these technologies allow Blazor Server to push UI changes into the client without the client requesting those changes.
PowerShell logo

PowerShell Script: Scan documentation for broken links

- PowerShell
A lot of documentation will link to other locations on the web using URL's. Unfortunately, many URL's change over time. Additionally, it's easy to make typos or fat finger resulting in incorrect URL's. Here's a small PowerShell script you can run on your documentation repositories and will tell you which URL's are not resolving in a proper redirect or HTTP StatusCode 200
Serilog logo

Changing Serilog Minimum level without application restart on .NET Framework and Core

- .NET
There are many ways to configure Serilog. The configuration library has the additional advantage that it supports dynamic reloading of the MinimumLevel and LevelSwitches.
.NET Bot writing on a whiteboard

Using ConfigurationProviders from Microsoft.Extensions.Configuration on .NET Framework

- .NET
.NET Core introduced new API's. Some of those libraries are built to support multiple .NET platforms including .NET Framework. So, if you're still using .NET Framework, you could also take advantage of these new libraries.
Umbraco logo

Introducing Umbraco's KeepAlive Ping configuration

- Umbraco
Umbraco 8.6 introduces the new keepAlive configuration inside of `umbracoSettings.config` which allows you to change "keepAlivePingUrl" and "disableKeepAliveTask"
Azure Application Insights logo

Capturing ASP.NET Framework RawUrl with Azure Application Insights

- Azure
By default, Application Insights will capture a lot of data about your ASP.NET applications including HTTP Requests made to your website. Unfortunately, the URL captured by Application Insights doesn't always match the URL originally requested by the client.