madskristensen / BrowserReloadOnSave

A Visual Studio extension
Other
27 stars 10 forks source link

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

Closed dotnetshadow closed 5 years ago

dotnetshadow commented 7 years ago

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: https://github.com/madskristensen/BrowserReloadOnSave/issues/5

Then the same type of issue was opened here: https://github.com/madskristensen/BrowserReloadOnSave/issues/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?

GlynP commented 7 years ago

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

madskristensen commented 7 years ago

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

GlynP commented 7 years ago

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

MarioPrograms commented 7 years ago

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

dotnetshadow commented 7 years ago

@madskristensen any progress on this issue?

madskristensen commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

@madskristensen any further help on this?

demonclan commented 7 years ago

@madskristensen I have the same problem

dotnetshadow commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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".