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 – http://mis.cellaneo.us/PermaLink,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 http://support.microsoft.com/?id=313512 and http://support.microsoft.com/default.aspx?scid=kb;en-us;825791 and even http://support.microsoft.com/?kbid=867770 but nothing really matched the problem that we were getting. It wasn’t until I came accross this post http://dotnetfish.blogspot.com/2008/01/compiler-error-message-cs0016-could-not.html 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.