Edi Wang

.NET and Azure Developer

.NET C# Programming Language and .NET Platform

This Blog Now Runs on .NET Core 3.0 and Azure

Microsoft shipped .NET Core 3.0 GA on Sep 23rd with tons of new features and improvements. This blog has been updated to .NET Core 3.0 and still runs on Microsoft Azure with SCD deployment type on App Service. This blog post summarizes all key points for my blog migration. Starting with .NET Core 3.0 preview 8, I've been investigating migration for this blog, from .NET Core 2.2 to .NET Core 3.0. …
.NET Azure

Migrate Azure Application Insights to ASP.NET Core 3.0

.NET Core 3.0 will be released at this month's .NET Conf conference, many of my friends, including me, couldn't wait to use the preview version to migrate our apps. Fortunately, starting with Preview 7, the API surface is final and can be treated as an RC version. There should be no API difference between preview 7, 8, 9 and RTM. Today I will talk about migration tips for Azure Application …
.NET Azure Application Insight

About Per Monitor-DPI aware for WinForms Applications

WinForms is the traditional .NET desktop application workload running on Windows. For historical reasons, there are some problems with its support for high DPI and for different DPI screens, and this article explores the possible solutions. Windows "96" PPI history The default DPI for Windows systems (more precisely called PPI) is 96. PPI means pixel per inch, which means how many pixels are …
.NET WinForm DPI

Build a Simple Matrix Card in .NET

A Matrix Card is typically used in online games for authentication. I built a simple version of a Matrix Card in .NET Core today, let's check it out. How Matrix Card Works This is a typical Matrix Card for the game "World of Warcraft". It has a serial number to bind to the owner's game account, and then use the numbers in the table for validation. Suppose the hacker already knows your account …
.NET Matrix Card

Building a .NET Core URL Forward Service

I recently built a URL forward service named “Link Forwarder” using .NET Core 2.2. It’s open source and currently having a preview version deployed to my subdomain “go.edi.wang”. This article will share how I built it and what I learned. To help you understand the system and walk through the code, please check my GitHub repository for this project: https://github.com/EdiWang/LinkForwarder The …
.NET URL

IP Rate Limit for ASP.NET Core

In websites or API applications, we often want to block high-frequency requests in a short period of time for an IP to prevent boring people or malicious attacks. In ASP.NET Core, limiting the request rate of IP is now super easy, let's see. AspNetCoreRateLimit There's already a nice library for limiting request rate, called AspNetCoreRateLimit. GitHub: https://github.com/stefanprodan/ …
.NET ASP.NET IP

Reset Azure Blob Storage Content Type in .NET Core

My blog is using Azure Blob Storage to store images for posts, however, it went wrong these days when I am trying out Azure CDN, the cause is all my images requests are returning incorrect content-type. Let's see how to reset content type for files in Azure Blob Storage via .NET Core. When I uploaded images using the Azure Storage API for .NET, by default, without setting ContentType, which is …
.NET Azure Azure Blob Storage

Stop Generating Designer.cs for .resx files in .NET Core

In Visual Studio, if we add a Resource File (.resx) to a .NET Core project, you will find a ".Designer.cs" file is automatically generated and updated whenever the resource content changes. This file basically contains auto-generated code for accessing resource values by key. In my blog system, I use the Resource File to maintain the default configuration data when setting up the blog for the …
.NET Visual Studio

How to Pack a .NET Core Class Library and Upload to NuGet

NuGet is the package manager of the. NET world, we can both use official website nuget.org, or build our own corporate and private servers. Now, with . NET Core, it's easier than ever to pack and upload a NuGet package, let's take a look! NuGet Account If you want your package to be used by every .NET developers in the world, then you need to have a nuget.org account to upload your own package.  …
.NET NuGet

Send Email in .NET Core via MailKit

The ability to send e-mail notifications is common in a variety of systems. My blog can also send emails to administrators when there are new comments, new replies, or when articles are referenced by other sites. So in. NET Core, how can we send an e-mail? My case will use Microsoft Outlook.com's personal account to send e-mail, using the SMTP protocol. But you can also do it with other SMTP- …
.NET Email MailKit SMTP