Link to home
Start Free TrialLog in
Avatar of qryz
qryz

asked on

Sporadic Compilation Error with User Control in ASP .NET 2.0 Web App

I am running an ASP .NET 2.0 Web Application on Windows Server 2003 with IIS 6.  Occassionally I will get an error when trying to browse to a page that includes a User Control, in this case one called "reportnav"  As you can see from the error below, the compiler says that the class "ASP.reportsnavsub" which is the class for the "reportnav" user control, exists in multiple temp directories.  This error has come up several times now and seems to be sporadic.  What can I do to avoid this problem?  I have been able to fix it by simply changing the name of the class in the user control, but I would love to know what is causing this so that I can take care of the root problem.

Thanks in advance for your help!
Server Error in '/PDTrac 071208Test' Application.
--------------------------------------------------------------------------------
 
Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
 
Compiler Error Message: CS0433: The type 'ASP.reportsnavsub' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\pdtrac 071208test\41b7edd9\874b697c\App_Web_2t5gzi_2.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\pdtrac 071208test\41b7edd9\874b697c\App_Web_irsy051m.dll'
 
Source Error:
 
 
 
Line 410:</div>
Line 411:</div> 
Line 412:<uc:reportnav id="reportnav1" runat="server" />
Line 413:
Line 414:

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of qryz
qryz

ASKER

samtran0331,

Thanks for the help!  That sounds like it is the root of the problem.  This is on our dev machine.  How do you go about clearing that folder several times a day?  You don't stop and restart IIS each time do you?
If it is a development server, then multiple restarts/cache clear probably isn't necessary.
Only when new code is published to the server.

But on a developer's machine, especially if they do a lot of debugging, then yes, I would clear out the cache once a day or more if things seem "quirky"
 (which does mean restarting IIS and closing the solution in VS)

I have a shortcut on my desktop to execute:

iisreset

which is the command line command to restart iis
Avatar of qryz

ASKER

Thanks for your clear and helpful response and for taking the time to look at my question!