Mutually exclusive development errors

The old ‘Mutex could not be created’ error
I have been doing some development in a new Visual Studio 2008 environment and was trying to debug my web service that I had created. As this was a new environment some of the security settings needed to be configured to allow me to run in DEBUG mode. After settings these permissons and starting my web service again I was still getting debug errors so I browsed the ASMX file from within IIS and got a ‘Mutex could not be created’ error within IE.
As with most of these errors I am not the first person to encounter the problem but I thought it was worth mentioning that this solution worked for me;
  • Close down all open Visual Studio IDE’s
  • Go to the ASP.NET Temporary folder for the version of the framework under which your application pool is running. For my web service running as a ASP.NET 2.0 application this is located at <%systemroot%>Microsoft.NetFrameworkv2.0.50727Temporary ASP.NET Files.
  • Delete the folder for your application.
  • Reset IIS
  • Check that you can now browse to your page, or web service, using IE.
  • Then reopen your solution within the development environment.

Problem solved! No more Mutex errors and I could debug my web service in my development enviroment. If you are interested, there is a useful Wikipedia article on Mutual Exclusion.


Some problems are really well hidden!

error ASPPARSE: Could not load type… when building a Web Deployment Project
Whilst trying to build a Web Deployment project for my ASP.NET 2.0 Web Application I kept getting this strage compiler error that referenced a page that did not exist in my project. After looking at numerous sites where a similar issue occurred I finally came across this one that solved my problem –,guid,33daa7bb-101b-45ce-a520-a60a1bfa062e.aspx
Basically, an old page that did exist in my web project but had not been completely deleted was still hanging around and needed permanently removing – it had been excluded from the project but not removed. Once I had deleted the ‘hidden’ file I was able to successfully compile my web deployment project.

Visual Studio Run Time Error and

Could not load file or assembly ‘AjaxControlToolkit’ or one of its dependencies. Access is denied
This one was a bit of an odd one! Whilst trying to debug an ASP.NET 2.0 Web Application from within VS 2005 I started to get these errors, but I couldn’t figure out what I had changed that caused my homepage to stop loading when it had been working fine 5 minutes before. I tried recycling the application pool, restarting Visual Studio and banging my head against the wall.
So I retraced my steps and realised that I had been amending the <identity> element in my web.config file. I had set the impersonation attribute to True and set the username and password elements accordingly. The issue was that the domain user I had specified was not being recognised on the development server, for some reason that I am still trying to phathom. To solve my problem I had a couple options;
  • Change the domain user so that they have more permissons.
  • Add the domain user to the local administrators group on the development server.

Having made the change and recycled the application pool for good measure, I was able to access my webpage once again.

The force of good turns evil!

Compiler Error Message: CS0016: Could not write to output file
This pain in the ass caused myself and a colleague a days worth of scratching arounf trying to resolve. We were both developing multi-project applciations within VS2003 (although I believe this affect VS2005 as well) and getting this error when trying to compile EXE’s. Web projects and DLLs were fine but we could not figure out what was wrong.
I looked at and;en-us;825791 and even but nothing really matched the problem that we were getting. It wasn’t until I came accross this post that the answer was revealed.
A new AV policy had been applied to the machine that restricted write access to the TEMP folder. This was stopping Visual Studio from creating the EXE I was trying to compile as it uses the TEMP folder during the compilation process.