I have TypeScript files outside of my ASP.NET MVC applications.
These TypeScript files are common for multiple web apps.
Previously, if one modified a TypeScript file, a watcher automatically built it into js, but after that, one had to build the project or run a script copying the .ts
and .js
files into the web app's folder (~/Assets/js
), from where they are served.
Now we tried to hard-link the TypeScript root folder as NTFS directory junction into ~/Assets/js
.
The plan with this was to speed up development time, because if it'd worked, one only had to edit the TypeScript files in one place, and save them. No copying would be necessary to the output folder, since the files are linked there.
The results are not as expected. Sometimes, the edited files get refreshed (when reloading a page using them in browser), sometimes not.
Later I've read FileSystemWatcher
does not work with directory junctions, so I'd expect IIS uses a FileSystemWatcher
, which does not emit any change event if a developer changes a .ts file in its original, common place (where the junction points to).
I guess this is the case anyway, but somehow, sometimes the files get refreshed, I don't know how.
I could check with Fiddler, when the files are served wrong - the old version of the file is served, without the modifications - it is not cached in browser, but sent by the server.
Possible questions:
- How to solve this? :)
- How to disable file caching in IIS (Express) for development?
- How to properly link directories in IIS with change tracking working?