debug="false", website fails... debug="true" website works...

I've got an ASP.Net website (ASP.Net 2.0 running on Windows Server 2003 R2 all SP applied) that does not run when web.config has debug="false".  The error says to set debug="true" to see what the error really is. Problem is, when I set debug="true" the error goes away and the site runs fine.

Here's an example of the error output:

Unable to cast object of type 'ASP.display_articlelink_ascx' to type 'Display_ArticleLink'.

I have a user control called Display_ArticleLink that I load like this: 

         Dim objArtLink As Display_ArticleLink
         objArtLink = CType(LoadControl("~/Display/ArticleLink.ascx"), Display_ArticleLink)

 Oh, this code was working fine before the weekend (in debug="false" mode). I don't know that anything changed....

Any ideas?


8/27/2007 3:19:57 PM 12495 articles. 0 followers. Follow

7 Replies

Similar Articles

[PageSpeed] 32

Ok, this morning, when I changed to debug="true" the code started working. Now, a couple of hours later with debug still true, I'm getting the same error only this time the debug info prints out and shows the line where the failure is happening.

Why would this code, which has been working for months, suddenly stop working?

8/27/2007 4:34:05 PM

Looks like a reported issue mentioned on this post, for which a patch is available:

If you get the answer to your question, please mark it as the answer.
8/27/2007 5:07:09 PM

Thanks. That looks like it applies.  I may get this hotfix....

8/27/2007 5:31:17 PM

Hmm. I haven't installed that hotfix yet, but now it doesn't matter what I do to web.config (OR even following the steps in the link -- stopping iis, deleting all temp files, restarting iis) is fixing the problem.  Now what?Angry

8/30/2007 8:07:45 PM

Have you tried running the application on another machine? You mentioned it was working fine previously, so perhaps you need to investigate what else could have changed in the meantime.

If you get the answer to your question, please mark it as the answer.
8/30/2007 8:21:58 PM

hmm, well. I found another post that said to change web.config from: 

<compilation debug="true" strict="true" explicit="true">
<compilation debug="true" batch="false" strict="true" explicit="true">
The change being to add: batch="false".
So far, that seems to fix the problem.  I don't know what the implications of batch="false" are: 
what does it do, how is the application different, performance?

8/30/2007 8:27:39 PM

The link for the hotfix describes the workaround you mentioned too:

"This tells ASP.NET to dynamically compile individual .aspx/.ascx files into separate assemblies.  This avoids the circular reference issue that triggers the exception."

If you get the answer to your question, please mark it as the answer.
8/30/2007 8:53:10 PM

Similar Artilces:

Compilation debug = "true" vs. debug ="false"
If I run my site with debug="false" I get errors and can't make it past the login page.  If I run my site with debug="true" the whole site runs as it is supposed to.Is this common? What kind of errors are you getting? For whatever reason, I am no longer getting any errors.  I can't recall exactly what errors I was getting when things weren't working properly.At any rate, it's back to the way it should be.Thank-you for your reply, voodoo9055.  Your help, advice and expertise is always appreciated....

"copy website", "publish website", or just "copy and paste"
Hi: So far i know 3 ways to upload website from local pc to real server, but want to understand more: 1. In Visual studio menu, Build->Publish Web Site, if I choose a local folder, and start to run, you will find the published website in the local folder, and you will find some .dll files in Bin folder..., same thing, if the website is published to a real server folder, will be the same story. The main advantage is: when user opens the website, it will load faster because it is precompiled, Am I correct here so far? 2. The "copy website" function in Visual Studio is just copy...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD Bruce "Bruce Lamb" <> wrote in message > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

compilation defaultLanguage="vb" debug="true" ERROR
I don't have this error when I visit the site on But I have it when I visit my site on the internet!! The ERROR: Server Error in '/' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineOnly' beyond machi...

<compilation debug="false">in web.config throwing "Thread abort exception"
In Production server, <compilation debug="false"> throwing "Thread abort exception" for long running processes for more than 15-20 mins Event log message : Exception type: ThreadAbortException  Exception message: Thread was being aborted Can anybody help us!!!    It may have nothing to do with the debug mode. Is it possible the Session or Application is timing out and shutting down your thread while it's still trying to run?  Steve Wellens My blog...

Do we need setup "Debug = True" in web.config for debugging client-side debug?
The question is as the subject. When we debug client-side script, we need uncheck "Disable script debugging" in IE; attach debugger to the process of iexplore.exe; set breakpoints in clientside codes, but is that for sure we need to config web.config to allow debug? But we do need this step if we want to debug ASP.NET applications, right?   Thanks...

double quote
hello there...  i tried everything of think but not working the way i wanted to be... not sure what i'm missing...i'm generating a <span> in code behind and then using in javascript.... here is what i'm doing code behind: int i=0string _keywordID = "keyword";string _name = row["visit_info_nm"].ToString().Trim(); String _getElementByID = String.Format("<span id='{0}' OnClick = \"document.getElementById('{1}').value='{2}';\">{3}</span><br>", i, _keywordID, _name, _name); here is what it generate : <span id='1' OnClick = \"document.getElementById('keyword')...

"Failed to create AppDomain" error, after using "Copy Website"
I don't have IIS installed on my development machine. I don't see the IIS in Services in Control panel. I am using Visual Studio 2008 to develop websites. I think Visual Studio 2008 doesn't require IIS to run web applications! Using the "Copy Website" in Visual Studio 2008 I copied a website from my local development machine to a webhosting server. I connected to ftp site of the hosting company to do the copy. No problem there with the website on the hosting server and everything works fine on the hosting server. I can preview my site with no problem...

"Me" is better than "You"
Yes I know, strings are frozen. But let me talk about it, I really can't get through the idea of a PC talkin to me. I consider my PC as an extension of myself, not a dumb companion who addresses Me as You. Yes there are times when I get angry with Him while I work and get wrong calculations etc.., but it really is my fault, Me using wrong istructions and eventually wanting to find someone else to blame, but it's Me. And yes, I consider Thunderbird my mail program, reading my mail on my PC as Me. So I personally like to have Me in the header bar as a compact address ...

Using "+" or "||"
Using SQLAnywhere 5.5.04, I've gotten into the habit of using "||" in ISQL to indicate a string concatenation. I needed to paste my SQL statement into the PowerBuilder script painter for some embedded SQL, and PB didn't like the "||" very much at all. I changed it to "+" and it seems to be ok. Do these two operators indicate ~exactly~ the same thing? moin, afaik these two's are not the same! if you're using "||" and any term is NULL then in the resultstring the term will be ignored if you use "+" then the resu...

"Using" or "With"
Hi all Please can someone enlighten to me as regards the difference with the "Using" and "With" statement when accessing data - which is better, what are the limitations and/or any pointers. Many thanks. Regards DaveDavid WinchesterPlease mark as answer if this is the solution.  using gives you the ability to use the connection and it closes the connection directlly after you finish using it. and there is no need to try- cach - finaly. there is no limitation on using USING keywordMuhanad YOUNISMCSD.NETMy Blog || My Photos || LinkedIn I have a dataobject the re...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

Web resources about - debug="false", website fails... debug="true" website works... -

Resources last updated: 12/11/2015 8:18:19 PM