0
votes

I have some stupid problem.

I work with Razor pages .cshtml and when i add some code to my index.cshtml and save it, run, when app runing i change some code in this page, save, update page in browser and nothing not changed.

Example:

<div class="conntainer">
<div class="row">
    <div class="col-4"><h1>Test</h1></div>
</div>

I have this code, i will run app, and change for ex:

<div class="conntainer">
<div class="row">
    <div class="col-4"><h1>Changed data</h1></div>
</div>

After reboting page data are not changing, how i can fix it?

2
Could it be that the downloaded and rendered HTML is cached in your browser? Take a look at this page for ways to clear your browser's cache. Also, by "after rebooting" do you mean that you rebooted your computer?Jamie Taylor
@JamieTaylor i allready do lot thinks, i reboot PC, i clean cash but nothing not helpqunz666
Are you using any caching in code? For instance Response Caching?Jamie Taylor
@JamieTaylor no, i not use cachingqunz666
Are you experiencing this on the server or on your development machine?Jamie Taylor

2 Answers

1
votes

For me, changing the ASPNETCORE_ENVIRONMENT variable to "Development" (from "Production") within launchSettings.json - "Profiles" (as below)

  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },

Resolved this issue for me. I suspect as my Environment variable is set to Development within the projects solution these needed to match. Hopefully this helps.

0
votes

So problem was in to:

/Properties/launchSettings.json

Was changen this value:

"ASPNETCORE_ENVIRONMENT"

To fix it, value must be:

 "ASPNETCORE_ENVIRONMENT": "Development"