Skip to content

Blog

How to Use DbUp Without Embedded Scripts

I use DbUp for all my database migrations. It is super simple and when something goes wrong, you can fix it without much effort. So far, I never had any problems with the embedded scripts approach as it is explained in the Getting Started section of the official documentation and in my blog post.

However, while trying to get Docker working with DbUp I noticed that I must do a lot of extra work when I need to create a separate DbUp image for every migration project I use. It would be much simpler when I could reuse my DbUp project and only replace the SQL scripts. Unfortunately, the embedded scripts approach requires a rebuild of the project and I am back at the beginning.

Creating Let’s Encrypt Certificates on Windows with Win-Acme

Let’s Encrypt offers free SSL certificates to protect the traffic between your website and your visitors. Earlier this year I wrote about the hoops you need to jump through to use those certificates on Azure. This post shows you a way to use Let’s Encrypt certificates on your on-premises servers.

The objective of Let’s Encrypt and the ACME protocol is to make it possible to set up an HTTPS server and have it automatically obtain a browser-trusted certificate, without any human intervention. This is accomplished by running a certificate management agent on the web server.

The Mysterious Error in IIS When You Run an HTTP Site and Activate SNI

A few weeks ago, we run into a strange problem. We were in the middle of our Let’s Encrypt rollout, in which we create a dedicated certificate for each of our domains. Since we run multiple domains on a single web server with only one IP address, we need to activate SNI (Server Name Indication). That worked on all our servers - expect one. That server gave us this useless error page:

A system error has occurred. Try again and contact the system administrator.

How to Generate a Missing project.assets.json in Azure DevOps

We started a few weeks ago to target .Net Standard in our class libraries. While our applications remain for the foreseeable future on the .Net (Full) Framework, we like to start moving code towards .Net Core. Building our solutions in Visual Studio worked without any problems, but as soon as we try to do that in Azure DevOps, we run into this error:

C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): Error NETSDK1004: Assets file 'c:\agent\_work\95\s\***\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

How to Activate TLS 1.2 on Windows Server 2008 R2 and IIS 7.5

There is always that one machine that you cannot upgrade on a current version because some dependencies outside of your control demand that specific configuration. You may postpone the inevitable, but one day you run out of luck. If your box is a web server, that day will come sooner than you think.

Out of the box, IIS on Windows Server 2008 R2 offers Transport Layer Security only in version 1 (TLS 1.0). That version is outdated and should not be used for securing any HTTPS traffic. Unfortunately, you do not see the version your browser uses to connect to a web server and so it may be that this protocol is still active. If this is the case, your users will not be able to visit your web site when all major browsers block that version at the beginning of 2020.

Little SQL Server Tricks: Creating a Range of Numbers

Some tasks I do in SQL Server would be much simpler if I could get a sequence or a range of numbers. I could create users#1 to user#1000 without any programming – just by using plain old SQL. PostgreSQL offers the generate_series function for such use cases. Unfortunately, there is nothing comparable in SQL Server. All you can find on Google are solutions that are complicated, long and impossible to remember.

Working with Temporary Files in .Net

Working with files in .Net is straightforward. You can use the File or FileInfo classes and call the method with the self-explaining name to create, copy, move or delete files on your system.

However, sometimes all you care about is to write some temporary data to a file. In this case the Path.GetTempFileName() method is exactly what you need. This method creates a uniquely named, zero-byte file in the user's temporary folder and returns the full path of that file.

How to Fix Network Errors with Docker and Windows Containers

Last week I run into this annoying problem when I tired to run the .Net samples for Docker:

Step 7/23 : RUN dotnet restore
> Running in ce2d8740cf2e
Restore completed in 389.74 ms for C:\app\dotnetapp\dotnetapp.csproj.
Restore completed in 220.85 ms for C:\app\utils\utils.csproj.
C:\Program Files\dotnet\sdk\2.2.402\NuGet.targets(123,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\app\dotnetapp.sln]
C:\Program Files\dotnet\sdk\2.2.402\NuGet.targets(123,5): error : No such host is known [C:\app\dotnetapp.sln]
The command powershell -Command $ErrorActionPreference = Stop; $ProgressPreference = SilentlyContinue; dotnet restore returned a non-zero code: 1