For literally years, my website has very intermittently thrown the following exception:
Multiple controls with the same ID 'ctl00$ctl00$ctl34' were found. Trace requires that controls have unique IDs.
at System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize, Int32 controlStateSize)
at System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState)
.... etc (entire stack trace is within System.Web namespace)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Sometimes a user will go to a page and this exception will be thrown - it happens on different pages and different control ids show up. Often, reloading the page will work. Other times, the exception will persist for a few refreshes before fixing itself.
Now I know that this error usually occurs when you are adding dynamic controls to a page and you accidently use the same ID within the one naming container, so I understand the meaning of the error.
But on my site, I am not adding dynamic controls. At least not that I know of.
I am running third-party components like Umbraco, Telerik and Peter Blum, and they are almost certainly adding control dynamically to the control tree at times, but, like I said, this error has been around for years, across major versions of all of these modules.
The intermittent nature of the exception suggests some sort of multi-threaded timing issue or use of a random number somewhere. Who knows... I can't find the cause of it in my code.
So my question is - how could I go about debugging this issue, given that the entire stack trace is within the .NET framework?
From my experience this happens when you update pages (files) on your server with out first open the app_offline.htm , and at the same time some user try to open your site.
Especial if you update the files from ftp (thats take some time) or when you upload only the aspx or only the code behind file.
So while you uploading the files, the asp.net trigger the compilation because he finds some different on file, but because the files are not fully updated, there is a mess up with the compiled dlls.
Other possible way is to disable the optimize on compile and force him to compile most of the files, even tho I think that this trick not work on me.
<compilation optimizeCompilations="false">
Hope this help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With