got error ” The “RazorGenerate” task failed unexpectedly. ” .After Updating to VS 16.8 and upgrade to .net 5.. the core version target is Core 2.2

The fix for me was to introduce a new System Environment Variable with the Key “DOTNET_HOST_PATH” and the value “dotnet” and then to restart Visual Studio.

Leave a Comment