graem
graem

Reputation: 75

IIS Not Receiving Updates to HTML?

I am working on a .NET Core 3.1 project in Visual Studio. Before I upgraded from 2.1 to 3.1 and VS2017 to VS2019 I was able to change html/css/js and refresh the browser to receive the updated files. Since the upgrade however, I have to stop IIS Express and relaunch it for every change I make. This slows down any front-end work considerably.

I have tried using incognito windows, clearing the cache, different OS, etc., but that has not worked.

Edit: site.css gets updated when I refresh but the other css and html files don't.

Any help would be greatly appreciated.

Upvotes: 0

Views: 914

Answers (2)

Roar S.
Roar S.

Reputation: 10679

Try adding Nuget package

Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation

to your web project and adding

"environmentVariables": {
   "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
}

to your profile in launchSettings.json.

Upvotes: 2

frostshoxx
frostshoxx

Reputation: 536

There are a few things that it might be worth trying:

  1. Depending on how html/css/js are generated in your project, make sure the build code are in fact updated the files (check local vs test vs prod configuration while at it).
  2. If these files are static, check if the property is set to copy if newer or always copy.
  3. Try set the IIS deployment to delete all existing files and copy the entire new content (this is to rule out and confirm that the build code actually get update. Make sure do it in test environment, so you won't take down production site during the deployment).

Upvotes: 1

Related Questions