Quantcast
Channel: Rick Strahl's Web Log
Browsing latest articles
Browse All 670 View Live

Image may be NSFW.
Clik here to view.

Caching your WebView Environment to manage multiple WebView2 Controls

I've been struggling with some WebView initialization issues that are showing up in my application logs from a deployed application. Personally I've never run into these issues myself, however my...

View Article


Image may be NSFW.
Clik here to view.

Save Files With Elevated Permissions on UnauthorizedAccessException

When building Desktop Applications that are document centric and that allow users to save files in any location - like an editor for example - you can run into a situation where on rare occasions a...

View Article


Image may be NSFW.
Clik here to view.

Embedding a minimal ASP.NET Web Server into a Desktop Application

Have you ever wanted to embed a Web Server into another application like a Desktop app for example? It's not a common scenario but I've had a number of occasions where I've had a need for this:Markdown...

View Article

Image may be NSFW.
Clik here to view.

Integrating OpenAI Image Generation into a .NET Application

I fell down a rabbit hole after playing around with various image generation AIs and decided that for me this is incredibly useful functionality that I would like to integrate into Markdown Monster -...

View Article

Image may be NSFW.
Clik here to view.

Working around the WPF ImageSource Blues

While working on the OpenAI Image Generator Addin from my previous post I ran into several behind the scenes issues related to the blasted Image control in WPF.Specifically I ran into two issues with a...

View Article


Image may be NSFW.
Clik here to view.

Sharing Tab Missing in Windows Folder Properties

For unfathomable reasons, Windows 11 is actively discouraging the Sharing Tab on the Explorer Properties Context Menu, where it used to sit by default.I'm talking about this tab when you select a drive...

View Article

Image may be NSFW.
Clik here to view.

Reading Raw ASP.NET Request.Body Multiple Times

Some time ago I wrote about retrieving raw HTTP request content from an incoming request and - surprisingly - it's one of the most popular posts on this blog. The post discusses a few ways how you can...

View Article

Image may be NSFW.
Clik here to view.

Comparing Raw ASP.NET Request Throughput across Versions

It's that time of year again to upgrade to a new machine, and one of the first things I often do once the machine is set up is run some performance tests of a simple ASP.NET application that tests raw...

View Article


Image may be NSFW.
Clik here to view.

Html to PDF Generation using the WebView2 Control

I've been using HTML to PDF generation for quite some time for a variety of purposes specifically in Markdown Monster. There are many solutions available - some good, some bad and many very expensive =...

View Article


Image may be NSFW.
Clik here to view.

ASP.NET Core Module with Shadow Copy Not Starting: Separate your Shadow Copy...

I recently ran into a problem with random failures of my ASP.NET Core Web application on IIS where I would get the dreaded ACNM Error Page (ASP.NET Core Module):This is on what used to a be a stable...

View Article

Image may be NSFW.
Clik here to view.

Speed up your Start Menu by disabling Web Search

I ran into a great tip yesterday on X, that is too good not to pass on and also to serve as a reminder for myself next time I install Windows:Holy hannah! Disabling web search on the start menu makes...

View Article

Image may be NSFW.
Clik here to view.

Mime Base64 is a Thing?

In all my years of developing software, sending binary data back and forth I've never heard of Mime Base64. Apparently that is a thing for email encoding of binary data for some legacy applications...

View Article

Image may be NSFW.
Clik here to view.

C# Version String Formatting

How many times have I sat down trying to get versions formatted correctly for display? Inside of an application to end user? Too many!Sure, it seems easy enough - you can use version.ToString() or...

View Article


Image may be NSFW.
Clik here to view.

Dealing with Platform Specific Classes and Methods in CrossPlatform .NET

If you build libraries for .NET Core, you always have to take into account that they can be used cross-platform. If you're like me and have many older libraries scattered with a few methods and classes...

View Article

Image may be NSFW.
Clik here to view.

Work around the WebView2 NavigateToString() 2mb Size Limit

The Microsoft WebView2 control has an issue with navigating to string content that exceeds 2 megabytes.This is a nasty, but documented limitation of the WebView2.NavigateToString() method. Nasty...

View Article


Image may be NSFW.
Clik here to view.

Back to Basics: Await a Task with a Timeout

The other day I needed to set a TaskCompletionSource and wait on an operation to complete. Easy enough - you can just await the tcs.Task. But in some cases the operation doesn't complete, and so it's...

View Article

Image may be NSFW.
Clik here to view.

Create a .NET PlantUML Markdown Render Extension

It's been a while since I've posted some Markdown Monster content, so I thought I'd share a fun feature I recently added to my Markdown Monster editor. In the process I'll highlight a useful library...

View Article


Image may be NSFW.
Clik here to view.

Nuking Local Nuget Package Sources to show newly Published Packages

I've run into this scenario way too many times as a NuGet package creator:I update a NuGet PackageI publish it to NuGet Package StoreI wait a few minutesI open another projectI try to update and...

View Article

Image may be NSFW.
Clik here to view.

Getting the ASP.NET Core Server Hosting Urls at Startup and in Requests

Today I was helping out a customer with their ASP.NET core application that wasn't starting up on a live server, hosted in IIS. Not uncommon in a first install, and when this happens I often resort to...

View Article

Image may be NSFW.
Clik here to view.

Using Sql Server on Windows ARM

I recently picked up a Windows ARM device in the form of a Samsung Galaxy Book 4 with a SnapDragon X Elite chip. Best Buy had a sale going for $799 at the time, and so I 'snapped' one up.I've been...

View Article

Image may be NSFW.
Clik here to view.

Getting the Current TabItem when the Tab is not selected in WPF

This is a quick reminder to self on how to retrieve a TabItem from a WPF TabControl when the tab is not currently selected because I run into this quite frequently and the flail around trying to...

View Article


Image may be NSFW.
Clik here to view.

Back to Basics: Using the Parallel Library to Massively Boost Loop Performance

A few days ago I posted a quick note on X about a specific use case of using the Parallel library in .NET to massively optimize a link look up operation in Markdown Monster with very little code. That...

View Article


Image may be NSFW.
Clik here to view.

Comparing Raw ASP.NET Request Throughput across Versions: 8.0 to 9.0 Edition

Whenever a new release of .NET comes out I run a comparison test of versions using some of my own load testing tools and in this post I look at .NET 8.0 to 9.0. These posts tend to be a a bit rambling...

View Article

Image may be NSFW.
Clik here to view.

Retrieving Images from the Clipboard Reliably in WPF Revisited

I've written previously about image formatting issues with the clipboard data in WPF and for the most part what I discussed in that post has been working just fine.Recently however I started noticing...

View Article

Image may be NSFW.
Clik here to view.

Inline Confirmations in JavaScript UI

Confirmation dialogs or modal popups can be annoying in HTML applications. What if you could instead use an inline UI to confirm an operation? In this post I describe a simple way you can use an inline...

View Article


WkHtmlToPdf: Dealing with broken Url Encoded and Extended Character Links

WkHtmlToPdf is a commonly used tool to create PDF documents from HTML files or Urls. Unfortunately it's a bit cranky and one of the problems you can run into is that links that include URL encoding...

View Article

Using Application Insights in .NET Desktop Applications

Using Application Insights with desktop applications isn't the most obvious operation, as App Insights has been primarily designed as a tool for providing logging, statitics and exception report for...

View Article

Preventing iOS Textbox Auto Zooming and ViewPort Sizing

If you've build mobile Web applications that need to run on iOS Safari and on an iPhone you might have run into the problem of input fields 'auto-zooming' the display when the input field and popup...

View Article

Setting an Absolute Output Path for .NET SDK Projects

By default .NET SDK project dump their final build output into a deeply nested folder structure that describes the build configuration, target, platform and sometimes additional package folders. While...

View Article



Sending and Receiving GMail Email Attachments that contain Code or Binaries

As a developer, you're likely to occasionally send an email with attachments that are either code or binary executable files either as straight files or in a zipped up collection of code or binary...

View Article

Removing the IIS Server Request Header from ASP.NET Core Apps (any version)

ASP.NET Core applications that run on IIS as InProcess output an Server name for IIS into the HTTP headers. If you want to remove the server header, you'll find that the process for IIS is different...

View Article

Implementing Two-Factor Auth using an Authenticator App in ASP.NET

Two factor authentication using Authenticator apps is getting more popular. One advantage of Authenticator 2FA is that you don't need to use a service nor do users have to provide additional bits of...

View Article

Getting .NET Library Projects to Output Dependent Assemblies

Recent .NET Core versions have changed how .NET Core Library projects output dependencies into the build folder. The new behavior doesn't output depdencies, unlike full framework .NET projects which...

View Article


Getting the .NET Desktop Runtime Installed with a Custom Runtime Checker and...

I've recently moved my Markdown Monster Desktop Application to .NET 7.0 and I had to make a decision on how to get the Runtime installed or packaged with my application. In this post I review the...

View Article

A WPF Statusbar Control

Statusbar controls are boring, but because of the way that they are used there are a number of caveats like ensuring the UI updates even in linear code, allowing for timeouts of status messages and...

View Article

Map Physical Paths with an HttpContext.MapPath() Extension Method in ASP.NET

ASP.NET Core doesn't have a Server.MapPath() method as classic ASP.NET had, and getting at the root path in Core is a little bit more involved than in those older versions. In this post I describe how...

View Article


Dotnet Tool Component not found on the Mac

I've run into this problem a few times: I install a new Mac OS and then install the .NET SDK. A bit later I install a dotnet tool using `dotnet tool install -g` and then try to run it, only to find out...

View Article


IIS Error 500.19 with ASP.NET Core Application

Running on IIS locally is pretty rare, but if for some odd reason you decide to run IIS locally on your dev machine you might find yourself getting a 500.19 error which relates to an issue in the...

View Article

Rolling Forward to Major Versions in .NET

.NET Core has sophisticated policies that allows your applications that are compiled to specific versions of the .NET Runtime can roll forward to newer versions. You can specify what part of the...

View Article

Image may be NSFW.
Clik here to view.

Resolving Paths To Server Relative Paths in .NET Code

ASP.NET Core automatically resolves 'virtual' paths in Razor pages or views to a site relative path. So if you have something like:<script src="~/lib/scripts/helpers.js" /> It will resolve to the...

View Article

Image may be NSFW.
Clik here to view.

Accessing Windows Settings Dialogs from Code via Shell Commands

I was unaware of this: You can access Windows configuration dialogs via an ms-settings: shell command via command Uri that works with:Shell Commands in your applications (ShellExecute() or...

View Article


Image may be NSFW.
Clik here to view.

Making Html Input Controls Truly ReadOnly

Although HTML has support for readonly control content, the behavior is not really well implemented in Web browsers. readonly display some minimal alternate styling (which you can customize via CSS),...

View Article

Image may be NSFW.
Clik here to view.

Using Windows.Media SpeechRecognition in WPF

Windows has a pretty capable SpeechRecognition engine built-in via Windows Media services. In .NET these features are accessible via the Windows SDK (WinSdk) that expose these Windows features to .NET...

View Article


Image may be NSFW.
Clik here to view.

The Strong ARM of .NET: Wrestling with x64 and Arm64 Desktop App Deployment

𝅘𝅥𝅮 The Strong Arm Of the Law - SaxonIf you follow me at all, you've probably heard me talk about some of my travails related to making a .NET Windows Desktop application — Markdown Monster— run well on...

View Article

Image may be NSFW.
Clik here to view.

WPF Image Control Local File Locking

WPF image locking has tripped me up a lot in XAML applications: The WPF image control by default locks image files when directly linking to an image file on disk. When you simply bind or assign an...

View Article


Image may be NSFW.
Clik here to view.

WebView2: Waiting for Document Loaded

When building hybrid Web applications where .NET code interacts with WebView HTML content, one of the biggest sticking points often is the event based disconnect between loading a document and then...

View Article

Image may be NSFW.
Clik here to view.

Lazy Loading the Mermaid Diagram Library

The Mermaid Diagrams Library is a large beast, and if you're using it selectively in your Web content you probably want to make sure you don't load it unless you actually need it due to it's large...

View Article

Image may be NSFW.
Clik here to view.

Configuring Microsoft.AI.Extensions with multiple providers

I just went through a bit of a struggle to find the right ways to instantiate different AI providers for a streaming completions project that I'm working on, and so I thought I'd write a short post to...

View Article

Image may be NSFW.
Clik here to view.

Distinguished Name on FileZilla Server Self-Generated Certs

Ah renewing certificates - my favorite tasks as an 'amateur' sys admin, running my own servers.I run a private Filezilla server on a port blocked IP address, and more than once I've stumbled on trying...

View Article


Image may be NSFW.
Clik here to view.

Adding Runtime NuGet Package Loading to an Application

One of the tool applications I've built sometime ago and use a lot, is my LiveReloadWebServer local Web server. It's a local .NET based Web server that you can point at a folder to serve as a Web site....

View Article

Browsing latest articles
Browse All 670 View Live