Adding new MVC/Razor items fails throwing an error about hostpolicy.dll

This article describes how to fix error “There was an error running the selected code generator: ‘Failed to load the dll from \bin\Debug\netcoreapp\win-x86\hostpolicy.dll, HRESULT: 0x800700C1 An error occurred while loading required library hostpolicy.dll’” when you’re adding a new scaffolded item (such as a Razor page or ASP.NET Core MVC Controller). Description Imagine this: You’re developing your run-of-the-mill, basic, everyday ASP.NET Core web application. You need to add a new scaffolded item – that is, This’ll result in an error somewhat like below: There was an…Continue reading Adding new MVC/Razor items fails throwing an error about hostpolicy.dll

.NET Core fundamentals in one picture.

How to disable “Register” action in ASP.NET Core?

Sometimes you’ll need the default identity for your ASP.NET Core application, but want to disable the registration of new users. Sounds pretty basic, right? However, there’s actually no easy switch you can just flip to enable or disable said functionality. I went through a lot of different articles and ideas by other people. Most of them involved fiddling with IdentityController, creating new scaffolded pages, adding new Actions with redirection code, and who knows what else… But who wants to fiddle with Identity? It’s glitchy and…Continue reading How to disable “Register” action in ASP.NET Core?

Azure DevOps - Always Be Shipping!

Fun with Azure DevOps NuGet package versioning!

This article will briefly explain the different NuGet package versioning schemes – both automatic and manual – available. Then we’ll take a look at how to implement a nifty, and quite frankly, downright elegant automatic versioning scheme for your NuGet packages. Okay – returning from quite a trip down another rabbit hole, I think it’s a good time to document some of my findings in regards to Azure DevOps NuGet package versioning! This seems to be another area, where the documentation certainly does exist, but…Continue reading Fun with Azure DevOps NuGet package versioning!

Debugging. Yeah, that's roughly what the process looks like. With all those tiny symbols and all. Debug/Trace/Whatever.

Adding Debug listeners to your console application fails in .NET Core

Every now and then comes the need to write your console output to a log file. There’s a simple way to do this in .NET Framework, and quite a few online articles detailing a borderline one-liner on how to do achieve it: Adding a log file listener(s) by calling Debug.Listeners – something like this: TextWriterTraceListener tr1 = new TextWriterTraceListener(System.Console.Out); Debug.Listeners.Add(tr1);   TextWriterTraceListener tr2 = new TextWriterTraceListener(System.IO.File.CreateText("Output.txt")); Debug.Listeners.Add(tr2); Source However, this doesn’t work in .NET Core anymore. Problem: Everything changes in .NET Core Using the code…Continue reading Adding Debug listeners to your console application fails in .NET Core

How to change the delimiter when exporting CSV from Excel?

Recently, I needed to find a way to import data from an Excel to a custom-coded system that could import CSV files. However, the data was fairly unsanitized – containing commas, semicolons and other weird characters. I could define the delimiter used in the imported data – however, to do that, I needed to also be able to define it in the export. What’s a “CSV” -file ? Stands for “comma-separated values” – A text file that uses a comma to separate values. Each line…Continue reading How to change the delimiter when exporting CSV from Excel?

Microsoft SQL Server logo

How to access local MSSQL server using SQL Server Management Studio?

Every now and then you run into a situation, where you really need to run some SQL against your local development database. That database, at least in my case, is hosted on your local SQL Server Express. Connecting to a local SQL Server should be a walk in a park, right? Eh, well… While using a connection string to connect to said DB is easy, you can’t do that with the SQL Server Management Studio. I wish you could, but hey – it is what…Continue reading How to access local MSSQL server using SQL Server Management Studio?

Microsoft Stream

Office 365 video migration to Office Stream imminent – Get Ready!

While this post will mostly be about the highly topical migration from Office 365 Video to Microsoft Stream, there’s also a fair amount of rambling about Microsoft’s partner strategy and a bit of history included. I’m starting with the main stuff and then proceeding to the ranty parts, so just skip the last 75% of the post if you don’t care about that kind of stuff! On to the content, then! Microsoft Stream is taking the world by storm There’s been a lot of buzz…Continue reading Office 365 video migration to Office Stream imminent – Get Ready!

Android Recovery Mode

How to use TWRP to flash an Android device that refuses to boot to TWRP?

Last Christmas holiday I was tasked by older relatives to fix an Android tablet they had bought. One of those absolutely useless, 100€ devices that can’t really run any apps, and struggle to even start. My first proposition was to return the device – but it was already past the return window. Lenovo‘s bloated nightmare-version of an Android was likely the biggest reason for slowness. My second course of action was to change the launcher and disable everything I could, but the device still couldn’t…Continue reading How to use TWRP to flash an Android device that refuses to boot to TWRP?

Azure Functions Core Tools (2.4.432) Function Runtime Version: 2.0.12332.0 - The system cannot find the file specified. Press any key to continue . . .

Azure Functions host quits with “The system cannot find the file specified”

So, another interesting issue I ran into when developing Azure Functions locally. What an endless bag of funsies! 😁 This time, the issue was simple but infuriating – my Azure Functions host would just silently close when debugging: none of the breakpoints would be hit, no information would be logged anywhere. Azure Functions Core Tools (2.4.432 Commit hash: 3371a87e0fce2aa35986c0de8e77d5d618163b91) Function Runtime Version: 2.0.12332.0 The system cannot find the file specified Press any key to continue . . . I first encountered this by the Azure…Continue reading Azure Functions host quits with “The system cannot find the file specified”

Azure Functions host be like ...

How to extract more information out of your Azure Functions host failing silently?

I dont’ know about you, but it’s happened to me a few times: fire up your Azure functions project, hit F5 to start debugging, project builds without errors, Azure Functions host starts… And shuts down right away. This article has a few quick and simple tips on how to extract a bit more information from Azure Functions host (func.exe), when it’s just silently failing. This means by default you won’t get any information about what’s going wrong. However, a couple of steps should get you…Continue reading How to extract more information out of your Azure Functions host failing silently?

Y2K20 - a new era of bugs

WordPress media uploads failing after year/month change? Easy fix :)

Oh, WordPress just keeps on giving! 😂 So it’s another year, and it’s time for some Y2k20-issues! I was too young to fix any Y2K-issues myself, so I guess it’s just fitting something breaks now. This article explains one possible fix to a situation, where your pictures in WordPress fail to show up. Symptoms So this was a fairly random WordPress-issue I encountered. It goes something like this: Suddenly each and every uploaded picture on your WordPress site fails to display. It’s available and editable…Continue reading WordPress media uploads failing after year/month change? Easy fix :)

SOLVE ALL THE ERRORS!

App Service refuses connections with error: “No connection could be made because the target machine actively refused it”

This blog post describes a very specific fix to a very specific issue. In a software project that consisted of a desktop client application and some APIs hosted on Azure, we ran into an error where some connections to APIs would fail with an error like this: No connection could be made because the target machine actively refused it. What gives? Description Imagine this: You’re connecting to an API hosted by an Azure App Service (“Web App”, if you wish) using an application or a…Continue reading App Service refuses connections with error: “No connection could be made because the target machine actively refused it”

Colleague enjoys tasty glass of maple syrup during presentation by hockey player - Photo by Canadian Internet Registration Authority (CIRA)

2019 – Year Review (200th post on this blog!)

When I started this blog in 2015 as a place to stash my, eh, thoughtful workarounds, I didn’t think I’d ever hit 200 live articles (with another hundred still in draft mode). Or that I’d get half a million people reading them in a year! Man, I didn’t know either one of these things when I was writing my 2018 review, which feels like was just a moment ago. Taking a look a bit further back, year 2017 living, working and traveling in the United…Continue reading 2019 – Year Review (200th post on this blog!)

Obfuscation is the language of Gods.

Obfuscar 2.0 errors with loading types from assembly

I plugged Obfuscar into my build pipeline (the easiest configuration ever, by the way) because I needed to obfuscate a DLL I was going to push as a NuGet package. The DLL was obfuscated without changing any of the public APIs, Classes or Parameters – only internal stuff was scrambled. Simple stuff. Essentially, this is what I was working towards: However, I wasn’t quite having the success I hoped for. Whilst the obfuscation was successful, and I could even reference the obfuscated DLL and use…Continue reading Obfuscar 2.0 errors with loading types from assembly

WordPress updates...

WordPress blog article edit mode: No Tags or Categories visible?

This post describes a couple of useful solutions or workarounds for an awkward situation, where you can’t manage the metadata of your articles on WordPress. This hampers greatly your ability to organize your posts – and if you’re using WordPress like I’m using, also lowers the visibility of your new articles (I’m using the tags as hashtags when sharing to social channels)! We don’t want that. But what’s actually causing it? Description of the issue So you know that little panel on the right hand…Continue reading WordPress blog article edit mode: No Tags or Categories visible?

Azure Active Directory, the advanced logo

Resolving error AADSTS90056

This post details my very simple solution to an extremely unnecessary and kind of a simple error I encountered when logging into SharePoint. However, you could run into the same error after configuring Azure Active Directory authentication to a custom web application. The error message comes in at least 2 variants. These are shown below: AADSTS90056: This endpoint only accepts POST, OPTIONS requests. Received a GET request. The other one I’ve seen doesn’t even mention OPTIONS, just POST: AADSTS900561: The endpoint only accepts POST requests.…Continue reading Resolving error AADSTS90056

SharePoint Localization - You can have your content in different languages for different users.

Classic SharePoint blogs are going away – what next?

So the interesting news are not over – Microsoft recently announced that their personal blogging platform for Office 365, Delve Blogs, is getting retired. Now it turns out Classic SharePoint blogs are also getting cut. This leaves some organizations in a bit of a tough spot – what to use for blogging from now on? In this article, I’m taking a look at what brought us here, and thinking about our next steps from here on forward. Background Okay, then – what brought us here?…Continue reading Classic SharePoint blogs are going away – what next?

ChromeWebDriver version in Azure DevOps build pipeline job's log output

How to find out which WebDriver version is installed on an Azure DevOps build machine using YAML?

Uh, okay, well. So this is where you should just RTFM (that’s along the lines of “check the documentation” for those uninitiated in the world of unnecessary abbreviations). But as we’ve found out before, Microsoft’s documentation on the agent’s installed software isn’t always up-to-date. That’s why I added this simple snippet on my pipeline to figure out which version of the browser AND the webdriver are installed on the machine. The snippets below can be combined with logic to install different versions of Chrome and…Continue reading How to find out which WebDriver version is installed on an Azure DevOps build machine using YAML?

My personal Delve Blog on my test tenant.

How to migrate your Delve Blogs content to Modern SharePoint?

You might’ve heard the news – Delve Blogs are on the way out, leaving your users without a blogging platform on Office 365, and their data homeless. And by homeless, I mean deleted pretty soon. And by pretty soon I mean really soon. Might be a good time to start thinking about storing it somewhere else instead! While we’re all still waiting to see whether Microsoft sticks to their ambitious schedule (partial content freeze in December 2019, total content freeze in January 2020, and finally,…Continue reading How to migrate your Delve Blogs content to Modern SharePoint?

Delve logo

How to export your Delve blogs content?

The news is out – Delve Blogs will be axed, leaving your users without a blogging platform on Office 365, and their data homeless. And by homeless, I mean deleted. Might be a good time to start thinking about storing it somewhere else instead! This post is the second post in my impromptu, Delve Blogs -themed blog series: Part 1: Delve Blogs getting deprecated – what do? Part 2: How to export your Delve blogs content? (this post) Part 3: How to migrate your Delve…Continue reading How to export your Delve blogs content?