Wednesday 25 November 2020

Quick fix for MSB4018 The RazorTagHelper task failed unexpectedly.

 After upgrading to Visual studio 16.8.0 some of your projects depending on Netstandard 2.0 may not build due to Razor Tag Helper task failing.

The Output Window will show a message containing the following:-

MSB4018 The RazorTagHelper task failed unexpectedly. 


The Fix

  1. Install 3.1 SDK of .NET Core. Can be located from the following link:- https://dotnet.microsoft.com/download/dotnet-core/3.1
  2. Add global.json file to your visual studio project and add the following to it to pin the project to 3.1 SDK:-

    {

          "sdk": {

                    "version": "3.1.403"

                      }

    }


To Reproduce

Open an existing .NET Core 2.2 app in VS 16.8.0

Build the project.

The Error will be displayed in the Error window and the project cannot be run.

Wednesday 11 November 2020

GIT intergration with Visual Studio 2019 version 16.8.0

 Git integration into Visual Studio 2019 is interesting, but has disrupted my usual work flow with the IDE.  The latest Visual Studio update changed the behaviour of Team Explorer tool window. So be careful when updating VS to version 16.8.0.

The removal of changes menu item from the Team Explorer menu, now is a bit of an inconvenience, and you have to use the Git menu on the main menu of the IDE.




Of course now you have a Git Changes Explorer tool window, another tab to click on to view the changes made in code files.  I prefer the old method, via Team Explorer, and the changes menu item, but I guess with time the Git Changes tab will grow on me.

However I do like the work items menu in Team Explorer.  You, now can create new branches from Azure DevOps Work Items using the new ‘create branch’ dialog. Just go to the Work Items panel from Team Explorer and right click a work item to create a new branch from it.  And out of the box the default source control provider is Git.

Is this a hint that Microsoft may drop Team Foundation Version Control?  Last year TFVC was dropped from the Visual Studio for Mac, and now Git is the default source control provider for new installations of Visual Studio 2019 seems to send a message that Microsoft have change of plans for TFVC.