Georg Jansen posted on November 03, 2005 09:13
Finally Log4Net Dashboard is up and running on ASP.NET 2.0!
I did come across a couple of problems.
Delegates:
I hade some delegates methods. In ASP.NET 1.0 I had the delegate definition in the same source file where I did the actually implementing of the method, which worked well inn ASP.NET 1.0. But when I compiled the project in 2.0 I got the error message:
error CS0246: The type or namespace name 'ShowErrorMessageHandler' could not be found (are you missing a using directive or an assembly reference?)
I had to move the delegate definition (public delegate void ShowErrorMessageHandler(string Message)) out of the original file – which belonged to the subnamespace L4NDash.PageNewEvents and into the Global.asax.cs file. It was not enough to change the namesapace in the PageNewEvents file.
I can’t give any precise reason for this problem – but I suspect it has something to do with the new “Assembly model” in Asp.net 2.0.
Assembly names
My next problem was for sure due to the new Assembly model. In Log4Net Dashboard I have a handler responsible for handling a custom section in the web.config file.
In my web.config file this handler is defined in the element:
<section name="l4ndash" type="L4NDashConfig.L4NDashConfigHandler, L4NDash, . . . >
The type attribute is referring to a class L4NDashConfig.L4NDashConfigHandler (which must implement the IConfigurationSectionHandler) and the name of the assembly (…, L4NDash, ) where the class can be found.
But in ASP.NET 2.0, the assembly names are generated, so I could not use L4NDash as the assembly name.
Well to make a long story short – I ended up in pulling the config handler out of the project and define a new class project with it’s own assembly (L4NDashConfig.dll).
Well anyway, L4NDash is now running on ASP.NET 2.0