I am having this frustrating problem. I change text in a razor view (cshtml), Start without Debugging
, refresh (Ctrl+F5) the browser but nothing happens. The st
I had this problem before. My case was i run windows 10 VM Parallel on Macbook Pro, and the project files are in shared folder with mac OS.
Incase someone has the same case like me, move the project to non shared directory such as C:\ will fix the problem.
On Parallel virtual machines, on the Macbook Pro, if the project files are in shared folders, the recompilation mechanism will not work; Copy the folder to drive C and the problem will be solved
If you're running on Mac using a Parallels WM and you project is located on you Mac-volume, you can solve this with using chmod.
chmod -R 777 *
Just had the same issue. After debugging for a long time and trying almost everything we found out that someone had moved the file from one folder to another in Visual Studio and checked that in to TFS. So the project file was updated but the original file still existed on disk. So my local IIS rendered the old file and not the new file on the new location.
This was frustrating, yes.
There are two ways to resolve this issue:
1. Check the permissions of folder in which your .sln file present.There may be a problem with file access permissions as Visual studio may not be to access files when IIS express server is running, so to reflect new .cshtml changes each time you need to restart the server,so I suggest edit the folder access permissions by:
Right click on folder->properties->security->click on edit button -> check all options->save.
Restart Visual studio to see changes.
If this does not work then use 2 option.
2.In your project in startup.cs file add this below line ConfigureServices() in method :
services.AddMvc().AddRazorOptions(options => options.AllowRecompilingViewsOnFileChange = true);
check your web.config
and make sure you do not have fcnMode="Disabled"
or fcnMode="NotSet"
use
<httpRuntime targetFramework="4.5.2" fcnMode="Default" />
or
<httpRuntime targetFramework="4.5.2" fcnMode="Single" />
- Default For each subdirectory, the application creates an object that monitors the subdirectory. This is the default behavior.
- Disabled File change notification is disabled.
- NotSet File change notification is not set, so the application creates an object that monitors each subdirectory. This is the default behavior.
- Single The application creates one object to monitor the main directory and uses this object to monitor each subdirectory.
FcnMode Enumeration