Solved

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

Posted on 2008-06-12
4
581 Views
Last Modified: 2010-04-21
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

0
Comment
Question by:qryz
  • 2
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 21780750
If the error doesn't occur consistently, I would say that the server cache is corrupt.
go to the folder:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

and delete everything in it...you might have to stop IIS and close VS.

Basically, every time you publish the app, or if this is your development machine ...every time you build/debug, you app code gets compiled into a dll and thrown into that folder. .Net determines whether or not the code has changed.
If it thinks the code is different, it creates a new sub-folder and puts the dll in there.
After a while, that folder gets "confused"...when you clear out the folder, and restart IIS and the app is launched for the first time, it will pull the current (and correct) dll...and there will be only one version of it.

I clear that folder out atleast 2x a day on my dev machine.
0
 

Author Comment

by:qryz
ID: 21782059
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?
0
 
LVL 37

Expert Comment

by:samtran0331
ID: 21782372
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
0
 

Author Closing Comment

by:qryz
ID: 31466613
Thanks for your clear and helpful response and for taking the time to look at my question!
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
creating a flowchart from an algorithm 5 30
Calling stored proc in EDMX 11 23
Jquery autocomplete 10 68
How code a 301 redirect for folder files -> 1 file 2 21
A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now