Skip to main content

Posts

Showing posts from August, 2020

GraphQL–HotChocolate–Read HTTP headers

Quick tip if you want to read the HTTP headers from the incoming GraphQL request in .NET Core using HotChocolate . There are 2 ways I found that can be used to achieve this: Inject the IHttpContextAccessor in your resolvers. Create a custom Query Interceptor and set the context data First one is rather obvious but let’s see an example on how to take the second approach: In your resolvers you can now access the context property through the ContextData directly or by injecting it:

Impress your colleagues with your knowledge about … the Immediate window

Sometimes when working with C# you discover some hidden gems. Some of them very useful, other ones a little bit harder to find a good way to benefit from their functionality. One of those hidden gems that I want to share today is a neat trick inside the Immediate window. With the Immediate window you can debug and evaluate expressions, execute statements, and print variable values. The Immediate window evaluates expressions by building and using the currently selected project. By default when you evaluate an expression in the Immediate window, the application state will change. If that’s not something you want, you can avoid it. Just add the , nse (no side effects) postfix to an expression, and it will evaluate without changing the application state. More information: https://docs.microsoft.com/en-us/visualstudio/ide/reference/immediate-window?view=vs-2019

Nuget Push: Method not allowed

When trying to push a newly created nuget package to Azure Artifacts it failed with the following error message: “Failed to process request. ‘Method not allowed’.” Here is the exact command I tried to execute: nuget.exe push –Source “Sample Source” –ApiKey AzureDevOps Example.1.0.nupkg The problem turned out to be related to the nuget.exe version I was using. It was still an old(er) version. After downloading the latest version( https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ) and re-executing the same command it worked as expected.

Visual Studio: The current page is inactive because you are not connected to a Git team project

After opening a git repo in Visual Studio I couldn’t do any git related action. All buttons were disabled and following message was shown on the top of the Team Explorer window: “The current page is inactive because you are not connected to a Git team project. Connect to a different project” Clicking on the Connect to a different project link brought me to the Manage connections screen where I tried multiple times to reselect the correct Azure DevOps repo. I even tried to switch the Source Control plugin type but nothing helped. In the end I tried the good old trick; restarting Visual Studio. After loading my solution again everything worked as expected. Strange…

On avoiding ‘big bang’ rewrites

I encounter too much organizations where they move from one ‘big bang’ rewrite to another. The situation always evolves in the same way: A new system is created that will replace an old system. But this time we’ll do it right. We throw out all the old technology and choose the latest and greatest shiny tools. After a few months/years/decades the new system finally sees the light and it looks awfully similar to the old system(although the user interface is a little better). This ‘new’ system over time becomes harder and harder to maintain. Adding new functionality costs more and more until we arrive at the moment where developers throw in the towel and declare it became impossible to add any new feature or change. It’s time for the next rewrite… Does this sounds familiar? A smart man once said: “The definition of insanity is doing the same thing over and over and expecting different results.” The mistake that is made is that the team focusses too much on the technology

Eventing and Messaging on Azure

There are a multitude of options available when choosing a messaging solution on Azure; Event Grid, Event Hub, Service Hub, … But which one should you choose? A first comparison can be found in the Azure documentation but the best explanation I found is by Clemens Vasters in a presentation he gave at .NET Conf . Here is the full presentation: And here is the one slide that explains the differences:

Azure SQL Learning Tools

Although every developer seems to know the latest and greatest new Javascript framework, some other more basic(/important?) skills seems to be lacking. One of these skills is good knowledge of SQL (Server). Although ORM’s made our life as developers a lot easier it has the side effect that people don’t know how to write a SQL query anymore. It is painful to watch how I see developers struggle when they have to write a stored procedure (a what…?).  So for all these developers out there that recognize themselves in the story above, you are lucky. The Azure Data team created a lot of new content that will help both beginners being introduced to Azure as well as SQL experts learn how to understand the benefits of Azure SQL. From the announcement : Microsoft Learn learning path: This six-course Azure SQL fundamentals learning path provides a built-in lab environment for you to learn at your own pace without a subscription. YouTube/Channel9 series: We offer more than 60 v

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

Release trains are NOT the solution

One of the techniques that you see in bigger organizations that struggle to move to an Agile mindset, is the introduction of Release trains: A release train tries to align the vision, planning, and interdependencies of many teams by providing cross-team synchronization based on a common cadence. A release train focuses on fast, flexible flow at the level of a larger product. It is especially used in SAFe(Scaled Agile Framework) organizations. Their definition of a release train is: Agile Release Trains align teams to a shared business and technology mission. Each is a virtual organization (typically 50 – 125 people) that plans, commits, develops, and deploys together. ARTs are organized around the Enterprise’s significant Value Streams and exist solely to realize the promise of that value by building Solutions that deliver benefit to the end-user. Based on the definitions above you would think that a release train is something you should aim for, an end goal you shoul

The resource utilization trap

I could write a whole blog post about the resource utilization trap(and don’t get me started on the word ‘resource’) but I cannot explain it better as demonstrated in this brilliant video: A must watch for every (project) manager…