Always ship Azure DevOps.

How to use the right version of the WebDriver on hosted agents in Azure DevOps?

We were working on getting our Robot Framework tests running during our builds on Azure DevOps. However, using hosted agents, it was quite a struggle to get all of the dependencies on the agent and make sure the tests can access the browser on the build machine. In our case, we were running the tests in Chrome. For this, we needed Robot Framework and some of its dependencies to be installed on the machine. Luckily, that wasn’t too complicated – however, getting the WebDriver that…Continue reading How to use the right version of the WebDriver on hosted agents in Azure DevOps?

Build successful? SHIP IT!

EF Core fails to load hostpolicy.dll when RuntimeIdentifier is win-x86

Ran into another interesting one when working with a .NET Core 3.0 project and Entity Framework Core – this time, RuntimeIdentifier configuration causing trouble. In short, running Update-Database (to apply code-first migrations to your local database) locally would return this, annoying error: Failed to load the dll from [runtimepath]\win-x86\hostpolicy.dll], HRESULT: 0x800700C1 An error occurred while loading required library hostpolicy.dll from [runtimepath]\win-x86\] I suspect this can happen with any x86 runtimeIdentifier, but the one I had specified in my .csproj-file was this: <RuntimeIdentifier>win-x86</RuntimeIdentifier> This value (or…Continue reading EF Core fails to load hostpolicy.dll when RuntimeIdentifier is win-x86

Blazor blazing away some geeks.

How to fix “The type or namespace name ‘Services’ does not exist in the namespace ‘Microsoft.AspNetCore.Components’ (are you missing an assembly reference?)”

Just resolved a random issue that’s difficult enough to google, that I think it’s worth documenting! These seem to be popping up whenever you work with anything that’s fairly fresh out of oven… This particular case revolves around Visual Studio being incredibly obnoxious, and starting to throw a ton of errors on code that worked five minutes prior. In my case, the error happened after updates to Visual Studio. Always fun. Symptoms The errors started popping up in Visual Studio. Basically, I just started getting…Continue reading How to fix “The type or namespace name ‘Services’ does not exist in the namespace ‘Microsoft.AspNetCore.Components’ (are you missing an assembly reference?)”

Azure DevOps - Always Be Shipping!

Azure DevOps – how to package a single DLL?

Okay – a quick piece of documentation that was a bit lackluster, so it’s again a good idea to log somewhere. How to package a simple DLL that’s a result of your Azure DevOps Pipeline? In my particular case, I have configured a post-build step to obfuscate the DLL, that’s first built by MSBuild. That works nicely. However, the default way to create a NuGet package, where you select a project (usually you pass the same variable to NuGet pack command that you used earlier…Continue reading Azure DevOps – how to package a single DLL?

.NET Core fundamentals in one picture.

How to use UriHelper or NavigationManager in .NET Core 3.0 & Blazor?

Just a quick piece of documentation, as this piece of code has changed in different versions of .NET Core 3.0 so far a few times. Need to have things like this written down somewhere! UriHelper / NavigationManager with .NET Core 3.0 Both of these helper libraries do essentially the same thing: navigate/browse/redirect the user to a different address, component, page or view in or by your web app. What you normally use this library for is exactly the same in all versions I’ve worked with,…Continue reading How to use UriHelper or NavigationManager in .NET Core 3.0 & Blazor?

Azure DevOps - Always Be Shipping!

Azure DevOps build fails with “The nuget command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages.”

This was another peculiar one – something, that didn’t bring up too many results on Google. Always fun trying to figure out those! So, when configuring an Azure DevOps pipeline (build) for a .NET project, you run into this annoying error: ##[error]The nuget command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages. Please specify either -PackagesDirectory or -SolutionDirectory. Job: “The nuget command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages. Please specify either…Continue reading Azure DevOps build fails with “The nuget command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages.”

A simple graphical explanation of Blazor's effect on the web development landscape.

HttpClient in Blazor

Blazor is a new (ish) framework for building web UIs with C#. It either uses SignalR to manage connections between your client-side and server-side code, or even compiles directly to WebAssembly, in both cases cutting out the need to write any pesky JavaScript yourself – pretty neat, if you ask me! However, developing your web apps with Blazor is a bit different from using ASP.NET MVC, for example. Other people have written great introductions to the tech, so I’ll stick to the problem at hand:…Continue reading HttpClient in Blazor