Thursday, 9 July 2015

Visual Studio Code on OS X - IOException: kqueue() FileSystemWatcher has reached the maximum number of files to watch.

This seems to get me every time I run up an app on my Mac when running an ASP.NET vNext Application.

So I run up the application in a terminal window:

Mac:MyMVCApp user$ dnx . kestrel
Started

The app starts fine. I then browse to my application and voila:

An unhandled exception occurred while 

processing the request.

IOException: kqueue() FileSystemWatcher has reached the maximum number of files to watch.
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x103c6a9d0 + 0x00029> in <filename unknown>, line 0

Cause

This is a known issue with new OS X kqueue FileSystemWatcher which will consume all file descriptors when watching very large directories:
http://www.mono-project.com/docs/about-mono/releases/3.12.0/

Solution
Pretty simple really, just issue the following command:
export MONO_MANAGED_WATCHER=false

Sorted!

No comments:

Post a Comment