Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT FIXED: Not refreshing on reload of cshtml file #7

Closed
dotnetshadow opened this issue May 9, 2017 · 17 comments · Fixed by #19
Closed

NOT FIXED: Not refreshing on reload of cshtml file #7

dotnetshadow opened this issue May 9, 2017 · 17 comments · Fixed by #19

Comments

@dotnetshadow
Copy link

dotnetshadow commented May 9, 2017

Hi @madskristensen,

Firstly we appreciate the effort you make towards all your extensions.

This issue keeps getting closed, even though it doesn't always get fully fixed:
It was first noted here:
#5

Then the same type of issue was opened here:
#6

In both cases the issue gets closed without someone verifying that it actually is fixed

Just to recap:
CSHTML - NOT WORKING
CSS - WORKING
JS - WORKING

Again I'll open the invitation to you, if you would like to remote into my computer and test this out yourself you are welcome to, let's try and get this issue resolved

UPDATE
I finally got the the browser to reload on save for .cshtml

The issue is that my projects are on my D drive under D:\Programming\Projects
I then moved one of my projects onto the C drive and it instantly worked

I'm not sure why it doesn't work on another drive as yet... I'll keep investigating, could be a permission problem?

@dotnetshadow dotnetshadow changed the title Not refreshing on reload of cshtml file NOT FIXED: Not refreshing on reload of cshtml file May 9, 2017
@GlynP
Copy link

GlynP commented May 16, 2017

Same for me. Reload on Save not working with VS2017 Community and an ASP.Net MVC website project.

@madskristensen
Copy link
Owner

Do you by chance have ReSharper installed? I wonder if the extensions conflict somehow

@GlynP
Copy link

GlynP commented May 16, 2017

Nope, ReSharper is not installed.
Here's a screenshot of all my installed extensions.
installed vs2017 extensions

@MarioPrograms
Copy link

I have this same problem. Only stop and start debugging fix the problem

@dotnetshadow
Copy link
Author

@madskristensen any progress on this issue?

@madskristensen
Copy link
Owner

@dotnetshadow I tried reproducing the issue yesterday and I couldn't. I tried it when debugger was attached and when it wasn't - works fine. I wonder if it could be FileSystemWatcher works differently on different Windows versions. I have Windows 10 and it works, what OS are you on?

@dotnetshadow
Copy link
Author

dotnetshadow commented Jun 2, 2017

@madskristensen I also have Windows 10 x64 Pro with all the latest updates

I think perhaps doing a teamviewer sessoin so you can see it on my machine might help you fix the issue? I'm happy to co-ordinate a time with you?

Visual Studio Detaiils
Microsoft Visual Studio Enterprise 2017
Version 15.2 (26430.12) Release
VisualStudio.15.Release/15.2.0+26430.12
Microsoft .NET Framework
Version 4.7.02046

Windows Details
Windows 10
Professional x64
Build 1703 (OS Version 15063.332)

@dotnetshadow
Copy link
Author

dotnetshadow commented Aug 20, 2017

@madskristensen hi Mads any chance of you taking another look at this? It still doesn't work with Visual Studio 2017 15.3 asp.net core 2.0

I see many people are still experiencing this issue, and it would be great to get to the bottom of it, is I can understand how frustrating is is for you and all of us.

Recently I had a different issue and David fowler used TeamViewer jumped on my machine and he was able to determine what the issue was

So I invite you again to consider perhaps doing a TeamViewer session so you can debug this further

@dotnetshadow
Copy link
Author

@madskristensen any further help on this?

@demonclan
Copy link

@madskristensen I have the same problem

@dotnetshadow
Copy link
Author

dotnetshadow commented Jan 30, 2018

@madskristensen @demonclan @MarioPrograms I finally got the the browser to reload on save for .cshtml

The issue is that my projects are on my D drive under D:\Programming\Projects
I then moved one of my projects onto the C drive and it instantly worked

I'm not sure why it doesn't work on another drive as yet... I'll keep investigating could be a permission problem?

@madskristensen
Copy link
Owner

@dotnetshadow Here's the code I use to listen for file changes

_watcher.NotifyFilter = NotifyFilters.Size | NotifyFilters.CreationTime;

Link to source

I wonder if the filters aren't catching the events from non-system drives or network mapped drives correctly. Perhaps I need to add additional filters? A quick google search didn't show any obvious answers.

@dotnetshadow
Copy link
Author

@madskristensen I appreciate you taking the time to look at this. I'm thinking it's something along these lines. The curious thing is that if I click on the icon "Refresh all Browsers" it actually does work. But when I click Ctrl-S to save it doesn't.

  1. In terms of the source file, is there way I can be debugging this. I'm not really good at vsix / extension stuff. What would I need to do to run a debuggable version?

  2. I'm also wondering if you could verify the results by creating a new asp.net 2.0 core project and putting it on a non system drive and see if you can replicate the issue?

@harikrishnakada
Copy link

Make sure you are not starting the application with debugging. For compile on the fly to work, the app must be started without debugging. Press ctrl+f5

@maddada
Copy link

maddada commented Feb 12, 2019

Hey, if you really want to reload on save and this extension isn't working, try this AHK script:

#SingleInstance, force
#NoEnv
#Warn
#IfWinActive, ahk_exe devenv.exe
^s::
{
Send, ^s
Send, ^!{Enter}
}
return
#IfWinActive

when you save, it'll automatically do the ctrl+alt+enter command.

@BjarkeCK
Copy link

So is it expected behavior that it's not working? I've disabled the razor pre-compiling feature, so I don't need it to recompile everything in order to see see the changes. Doing it a ctrl+alt+5 every time seems overkill.

@LukeOwlclaw
Copy link
Contributor

I determined that the changes are not detected because VS creates a temporary file (with random extension), then changes this temp files, and finally renames it. I sent a PR which also picks up changes of this "type".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants