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!

Thursday, 7 May 2015

Switching user accounts in Visual Studio

Occasionally I need to switch between Microsoft Accounts when signing into Visual Studio. To do this cleanly, it is necessary to reset the user data associated with visual studio.


  1. Exit Visual Studio
  2. Start the Developer Command Prompt
  3. Type  devenv /resetuserdata
  4. Start Visual Studio
  5. You will be prompted to sign into Visual Studio
EDIT: So this didn't work. In the end I needed to sign in as the original account, then sign out and sign back in again as the new account. It appears this was because Visual Studio needed to verify the original account first.

Welcome

My name is Dave and I'm an IT Consultant. Mostly I'm a developer focusing on the Microsoft stack and also I have a lot of experience working with SQL Server both from an administration and development perspective.

I've decided to publish various experiences, issues, findings, solutions and code snippets here as a way of preserving things I've found and making sure I can articulate it. After all, if I am unable to explain the topic publicly then I probably haven't understood it!