Skip to main content

Posts

Angular - Auto-unsubscribe

One of the nice underused features of Angular is the support for decorators (through Typescript). From the Typescript documentation: A Decorator is a special kind of declaration that can be attached to a class declaration , method , accessor , property , or parameter . Decorators use the form @expression , where expression must evaluate to a function that will be called at runtime with information about the decorated declaration.   A nice example of the usage of decorators is the ngx-auto-unsubscribe library.  This Class decorator that will automatically unsubscribe from observable subscriptions when the component is destroyed. An example:

error : NETSDK1061: The project was restored using Microsoft.NETCore.App version 1.0.0, but with current settings, version 2.2.0 would be used instead.

After adding a .NET Core Test project to my solution, the build on the server started to fail. These are the error messages we got: 2019-02-26T13:02:17.1451963Z C:\Build\_work\25\s\Data.Tests\Data.Tests.csproj : warning NU1604: Project dependency Microsoft.NETCore.App does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. 2019-02-26T13:02:17.1451963Z C:\Build\_work\25\s\Data.Tests\Data.Tests.csproj : error : NETSDK1061: The project was restored using Microsoft.NETCore.App version 1.0.0, but with current settings, version 2.2.0 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection . The strange thing was that building ...

Azure DevOps Extension for Azure CLI

Microsoft is introducing a new extensions for the Azure CLI, the Azure DevOps Extension. This extension adds Pipelines, Boards, Repos, Artifacts and DevOps commands to the Azure CLI 2.0. It replaces the VSTS CLI that has been deprecated and will no longer be receiving new features. Getting started Install the Azure CLI . You must have at least v2.0.49 , which you can verify with az --version command. az –version Add the Azure DevOps Extension a z extension add --name azure-devops Run the az login command. This will open up the default browser and load a sign-in page. You can also login using a PAT if you want. az login Set the default project organization and project name. This avoids that we have to do this for every command: az devops configure --defaults organization=https://dev.azure.com/ordina project=SampleProject Now we can try one of the available commands( https://docs.microsoft.com/en-us/cli/azure/ext/azure-devop...

Marten 3.4–Full text search support

I’m a big fan of Marten, the document database on top of PostgreSQL. With the Marten 3.4 release last week, we finally got full text search support (together with some other bug fixes and some performance improvements). PostgreSQL has built in full text search, with this release this functionality finally becomes available in Marten. Using it is as easy as writing the following LINQ statement: More information here: http://jasperfx.github.io/marten/documentation/documents/querying/linq/#sec24 Remark: To use this feature, you will need to use PostgreSQL version 10.0 or above, as this is the first version that support text search function on jsonb column - this is also the data type that Marten use to store it's data.

Azure DevOps - SonarQube - error CS0006: Metadata file 'Google.Protobuf.dll' could not be found

Automated deployments are great, until the moment your builds start to fail due to side-effects. Last week when trying to build and deploy an application using Azure DevOps, the build failed with the following error messages in the log: 2019-02-20T20:47:57.0671661Z   CSC : error CS0006: Metadata file 'D:\b\3\_work\_temp\.sonarqube\resources\0\Google.Protobuf.dll' could not be found 2019-02-20T20:47:57.0671661Z   CSC : error CS0006: Metadata file 'D:\b\3\_work\_temp\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll' could not be found 2019-02-20T20:47:57.0671661Z   CSC : error CS0006: Metadata file 'D:\b\3\_work\_temp\.sonarqube\resources\0\SonarAnalyzer.dll' could not be found I knew that I had seen this error before: https://bartwullems.blogspot.com/2018/11/tfs-build-sonarqube-error.html , but the things that worked then didn’t help. After rebooting the server, cleaning the build folder, praying to all the known and unknown gods, I final...

Grit - The power of passion and perseverance

As a consultant I have the privilege to work with a lot of different people, teams and customers. What I always find fascinating is how some people and teams grow and become successful where other teams keep running in circles failing to improve, this despite the fact that all these people are really talented and smart. So what makes that some teams succeed where others fail? My answer is simple, it is about how they handle failure and learn from their mistakes. Which brings me to the following TED talk :

Azure DevOps - Allow Scripts to Access OAuth Token

For a specific build task I’m using inside Azure DevOps it was required to allow the build to access the OAuth token to interact with TFS/Azure DevOps. This option is disabled by default and it took me some time to figure out where I could enable it. Here are the (easy once you know it) steps: Go to Pipelines –> Build . Select the build/release pipeline that you want to configure from the list and click on Edit in the right corner On the Edit Build Definition screen, click on the ‘Run on Agent’ section (in my case Agent Job 1) In the Properties , you find the ‘Allow scripts to access the OAuth token’ in the Additional options section