InvalidOperationException: Cannot find compilation library location for package 'Microsoft.Build'

Viewed 470

My project base on net6.0 was working fine with IIS launch setting but when i added serivce

services.AddRazorPages().AddRazorRuntimeCompilation();

It stop working on IIS but Working on IIS Express and Self host.

enter image description here

1 Answers

You can try to add this configuration setting to your .csproj file and then republish your site to the server.

<GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>
Related