We finally discovered this was caused by Visual Studios browser link functionality and to fix it we needed to disable it by putting this in the section of the web.config:
<add key="vs:EnableBrowserLink" value="false" />
Alternatively you can disable in in Visual Studio altogether.