ASP.NET Core with Angular not updating changes

霸气de小男生 提交于 2019-11-29 05:10:55
Ashu

I was facing same issue. Below steps worked for me:

  • Delete all files from dist folder
  • run "ng build"
  • When the application runs, if you still don't see the changes, Empty cache and hard reload the chrome browser (hold browser refresh button for long, and select "Empty cache and hard reload")

It appears to be I had to set the environment variable. Although it might be set on launchSettings.json, you have to run this command

$Env:ASPNETCORE_ENVIRONMENT = "Development"

for it to work properly. Took me since yesterday to find this, hope it helps someone else.

For me the problem was Visual studio had checked in the .js and .js.map files for a few of my .ts components.

Visual Studio also checks in the main-client.js, vendor.js, and vendor.css files by default. Makes sure to either remove these from source control (recommended) or check them out before running.

I too faced this problem while i executed my angular 7 with.net core app in IIS express in VS2017,

  • solved this by building the angular app(clientapp) in cmd by "ng build".
  • Then, close and reopen the application. so that VS loads the project again.
  • Now run the app using IIS express.
  • this worked for me. so give a try.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!