Kenil Vasani 646 Questions 567 Answers 77 Best Answers 26 Points View Profile 0 Kenil Vasani Asked: December 8, 20202020-12-08T03:14:16+00:00 2020-12-08T03:14:16+00:00In: .net 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 0 When Build Project. Error The “RazorGenerate” task failed unexpectedly. .Net Core 2.2 .net-core Share Facebook 1 Answer Voted Kenil Vasani 646 Questions 567 Answers 77 Best Answers 26 Points View Profile Best Answer Kenil Vasani 2020-12-08T03:14:23+00:00Added an answer on December 8, 2020 at 3:14 am 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. 0 Share Share Share on Facebook Share on Twitter Share on LinkedIn Share on WhatsApp You must login to add an answer. Username or email* Password* Remember Me! Forgot Password?