Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 389
sal Avatar asked Sep 01 '25 01:09

sal


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>
like image 140
samwu Avatar answered Sep 02 '25 19:09

samwu