Kenil Vasani 27 Questions 36 Answers 20 Best Answers 20 Points View Profile 0 Kenil Vasani Asked: November 19, 20202020-11-19T06:47:14+00:00 2020-11-19T06:47:14+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 .netcore Share Facebook 1 Answer Voted Kenil Vasani 27 Questions 36 Answers 20 Best Answers 20 Points View Profile Best Answer Kenil Vasani 2020-11-19T06:47:21+00:00Added an answer on November 19, 2020 at 6:47 am I did 3 steps to get it to build AND to get the ( ~/ ) variable to work. Open cmd and write this: setx DOTNET_HOST_PATH “%ProgramFiles%\dotnet\dotnet.exe” Open C:\Program Files\dotnet\sdk in here delete the folder: NuGetFallbackFolder Restart your pc! 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?