I have updated my visual studio 2019 to latest version with .net 5 after that any project with .net core 2.2 gives this error Error MSB4018 The "RazorGenerate" task failed unexpectedly. System.InvalidOperationException: DOTNET_HOST_PATH is not set at Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask.get_DotNetPath()
After one day try to run the project i find out that you have to install from huget PackageReference Include="Microsoft.NET.Sdk.Razor" Version="2.2.0" to solve the problem
After one day try to run the project i find out that you have to install from nuget PackageReference Include="Microsoft.NET.Sdk.Razor" Version="2.2.0" to solve the problem
This is something issue with VS. for me I have added 'DOTNET_HOST_PATH' path with %ProgramFiles%\dotnet\dotnet.exe . and restarted . problem solevd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With