page 1 of 1
Comments: 16 | Views: 21786
sbc
sbc
GW R/Me
Anyone ever got this error before and know how to fix it?

It just started happening to me for no apparent reason. All I did was edit the file. It is not compiled by Visual Studio, but dynamically:

<%@ Control Language="C#" src="mycontrol.ascx.cs"
Inherits="MyNamespace.MyStuff.MyControl" %>

Even though it is used on several pages, it only occurs on one of them. It has been in use for several years (so I know the code works).

Someone else had this problem with .NET 1.0 (I am using 1.1): error generated while debug is off, but no one answered. When debug is set to 'true' it works, when removing (or setting to 'false') the error occurs. Restarting the server is not an option (I did restart IIS, but that didn't work).
Harlequin
Harlequin
http://twitter.c​om/TrueHarlequin
Does your control also inherit:

System.Web.UI.INamingContainer

?
Harlequin
Harlequin
http://twitter.c​om/TrueHarlequin
Did you try inheriting System.Web.UI.INamingContainer in your control? Might help with the conflict...
footballism
footballism
Another Paradigm Shift!
    Probably it's not the problem with the user control, it's the problem with the page containing the control, can you post the code related to that page here?

Sheva
Harlequin
Harlequin
http://twitter.c​om/TrueHarlequin
Do you have any dll's in your bin directory you renamed recently?

Like:
/bin/MyClassLibrary.dll
...to...
/bin/MyClassLibrary.BAK.dll
footballism
footballism
Another Paradigm Shift!
sbc wrote:

Is there a way to reset permissions for the "Temporary ASP.NET Files" folder, or delete the contents of it?

    You are right, the real culprit behind it is that the temporary dll files won't delete, you can clear the IE cache(via Internet Explorer->Tools->Internet Options), then the temporary files will be cleared too.

Edit: if you want to manually clear the temporary file folder, then you have to shut down the ISS to turn the write lock off on this foler, then you can arbitrarily delete the dll files.

Sheva

sbc wrote:
Perhaps somehow the installation of .NET 2.0 has affected .NET 1.1 (that is the only thing I can think of that would do this), even though the web app doesn't use .NET 2.0


A friend of mine uses dasBlog on Windows Server 2003. Installing .NET 2.0 apparently broke it. His fix was to ensure that .NET 1.1 apps live in a different application pool from .NET 2.0 apps. Application pools share worker processes, and a process can only load one version of the .NET Framework, whichever is the first to load.

I don't know if this is relevant to your problem, but if you're on Windows Server 2003, it's probably worth trying.

Enough time has passed, I hope you found a solution. I had the same error on a Server 2003 Small Biz edition, also replicated in XP MCE and after lots of pouring through Google and Google groups, I found a solution in the comments of a Scottgu article. It suggested using adding the ClassName directive to the Controls ascx page. That resolved the problem.

Thank you for posting that dean-o. I still haven't found a solution and it's happening to me right now. Hopefully that ClassName directive will work for me.

Thanks again!

*EDIT*
That fix did not work Sad

I still have no idea  how to get this to work. I am using user controls as header/footer/sideBar and when I change them, and refresh the page it throws this error. How do I get this to not happen on live? Can I force a cache clear or something?
Not sure if you still have the same issue, but I did and since this was one of the first google hits, I thought I'd add my solution.

Reading around on the web it seems that there is no "fix-for-all'.

Clearing caches, removing old dll's and the like, rebooting a couple of times etc did not solve my problem. It started when I loaded a new version of a third-party dll. Attempting renaming and the likes of that is not feasable for me.

Finally, I discovered in my web.config that it still had a reference in the assemblies section to the old version of the dll. Completley removing that tag solved the problem!

If I am not mistaken, this is a relic of older versions of the framework where you had to specify referenced assemblies (or even got them automatically?). This project is currently running on Framework 2.0, but it has been on earlier versions as well, so probably residual code from 1.0 or 1.1 that caused this.
page 1 of 1
Comments: 16 | Views: 21786
Microsoft Communities