Kentico Scripts and Styles Won’t Load After Visual Studio Update

Kentico Scripts and Styles Won't Load After Visual Studio Update

After updating Visual Studio all the Kentico scripts and styles would not load within the page editor.

The page builder and form builder scripts and styles no longer load (404s) on the pages.

Nothing loads under /Kentico or /_content path.
Example:
/Kentico/Scripts/builders/builder.css
/Kentico/Scripts/builders/page-builder.css
/_content/Kentico.Content.Web.Rcl/PageBuilder/Admin/InlineEditors/DropdownEditor/DropdownEditor.css /_content/Kentico.Content.Web.Rcl/PageBuilder/Admin/Selectors/FormComponents/Attachments/attachment-selector.admin.js

I tried the following without any luck:

Cleared NuGet cache
Open main Kentico solution in Visual Studio (WebApp.sln) and go to Tools > NuGet Package Manager > Package Manager Settings >> select Clear All NuGet Storage button and then Rebuild the solution.

Cleared IIS cache
Clear IIS cached JIT compiled files to force IIS to rebuild the site when it loads again.
Delete all the files under:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

Cleared IIS history
Removed all IIS history under C:\inetpub\history

Install Kentico Hotfix
Install the latest Kentico Hotfix

Solved!
Turned out the only thing I had to do was to change the hostingModel from “InProcess” to “OutOfProcess” in the web.config file and rebuild the solution.

Apparently under .NET 6, Visual Studio update causes the defaults of the hosting model to be set “InProcess” and changing this to the “OutOfProcess” fixed the issue.

By default Visual Studio uses InProcess Hosting. This implies ASP.NET Core Module sends the requests to IIS HTTP Server.

If you use the OutOfProcess hosting model in your ASP.NET Core Application then IIS HTTP Server will not be utilized.

In the OutOfProcess Hosting, the Kestrel web server is utilized to handle your requests.