My ASP.NET App_code changes not getting picked up (or are cached??)

Patrick picture Patrick · Jun 17, 2011 · Viewed 14.1k times · Source

Help!! I have a single .cs file under a (root level) App_Code directory for the purpose of retrieving the correct template for the requested URL (it is linked to our own Content Management database). Initially, it was working fine - I could make changes to it and they were picked up by the web application OK. Then something happened (no idea what) and now whatever changes I make, they are not recognised. Even if I delete the entire App_Code directory, it makes no difference - I still seem to be picking up an earlier (cached??) version of what was in the App_Code directory. Code in the .cs file is below:

using System;
using Custom.CMS.Facade;
using Custom.CMS.BO;
public class CMHttpModule : IHttpModule
{
    code here...
}

The same problem occurs even after I have copied the website to our live server.

What I don't understand is - if I introduce a deliberate error to the .cs code, I still get a compilation error, and on successful compilation an App_Code.xxxx.dll is created under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

So what version of the App_Code is my web application actually picking up? How do I make it pick up the "correct" one?

FYI I am using C#, Visual Web Developer Express 2008 and IIS 6 web server

Any assistance would be gratefully appreciated.

Answer

Chris picture Chris · Apr 18, 2013

Reopening the solution also works.