tjanczuk / iisnode

Hosting node.js applications in IIS on Windows
Other
1.86k stars 587 forks source link

Changing files in WebStorm does not trigger watchedFiles to restart the app #406

Open langdonx opened 9 years ago

langdonx commented 9 years ago

When I change watched files in Notepad or Notepad++ the app is restarted and my changes are reflected immediately. However, when I change watched files in WebStorm, the app is never restarted and I'm forced to either iisreset or modify the Web.config as well.

I use .NET's FileWatcher to figure out what the difference might be. You can see the results are below. Are you relying on two changed events? Is the changed event that WebStorm fires somehow different than the two Notepad/Notepad++ are firing?

Thanks!

Notepad++

OnChanged
C:\source\orchid\ui\Gruntfile.js

OnChanged
C:\source\orchid\ui\Gruntfile.js

Notepad

OnChanged
C:\source\orchid\ui\Gruntfile.js

OnChanged
C:\source\orchid\ui\Gruntfile.js

WebStorm

OnCreated
C:\source\orchid\ui\Gruntfile.js___jb_bak___

OnChanged
C:\source\orchid\ui\Gruntfile.js___jb_bak___

OnRenamed
C:\source\orchid\ui\Gruntfile.js => C:\source\orchid\ui\Gruntfile.js___jb_old___

OnRenamed
C:\source\orchid\ui\Gruntfile.js___jb_bak___ => C:\source\orchid\ui\Gruntfile.js

OnChanged
C:\source\orchid\ui\Gruntfile.js

OnDeleted
C:\source\orchid\ui\Gruntfile.js___jb_old___
merpnderp commented 9 years ago

I'm having this issue too.

AMoo-Miki commented 7 years ago

By default, all JetBrains IDEs, use "safe write" to save your changes. This creates a temporary file, writes the new content there, deletes original file, and renames the temporary file.

I guess IISNode doesn't handle this. To solve your problem, turn off "safe write" from Settings > Appearance & Behavior > System Settings.