I'm trying to extend the ExceptionManage r Application Block and build a
custom publisher that writes my exceptions to the database. That's easy
part. The difficulty I am having is in configuring my web application to use
the custom publishers.
Things to note. I have a reference to
Microsoft.Appli cationBlocks.Ex ceptionManager in my web application
The Microsoft.Appli cationBlocks.Ex ceptionManager is in my GAC, so there is
no dll for it in my webapp\bin\debu g or release
I added this section at the top of my web.config file. At this time, I
haven't even included my custom database publisher, I just want to make sure
this is configured correctly.
<configSections >
<section name="exception Management"
type="Microsoft .ApplicationBlo cks.ExceptionMa nagement.Except ionManagerSecti o
nHandler,Micros oft.Application Blocks.Exceptio nManagement" />
</configSections>
<exceptionManag ement>
<publisher mode="on"
assembly="Micro soft.Applicatio nBlocks.Excepti onManagement"
type="Microsoft .ApplicationBlo cks.ExceptionMa nagement.Defaul tPublisher" />
</exceptionManage ment>
In my code, I have a web page which is throwing an exception, before it
throws it, I am calling the ExceptionManage r to publish the exception..
ExceptionManage r.Publish(ex);
According to the default behavior of the ExceptionManage r, the exception is
being writting into my event log properly.
However, I am getting ANOTHER exception, thrown by the ExceptionManage r
itself. I've pasted this exception below. Notice that it's not finding the
file
file:///c:/inetpub/wwwroot/lrwintranet/bin/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.DLL.
because it's not there, it's in the Global Assembly Cache!!
How can I configure this to know that my Dlls for the ExceptionManage r are
in the GAC?
Event Type: Error
Event Source: ExceptionManage rInternalExcept ion
Event Category: None
Event ID: 0
Date: 5/27/2004
Time: 11:22:48 AM
User: N/A
Computer: GDURZI-XP
Description:
1) Exception Information
*************** *************** ***************
Exception Type: System.Configur ation.Configura tionException
Message: Exception creating section handler.
(c:\inetpub\www root\lrwintrane t\web.config line 4)
BareMessage: Exception creating section handler.
Filename: c:\inetpub\wwwr oot\lrwintranet \web.config
Line: 4
TargetSite: System.Configur ation.IConfigur ationSectionHan dler
GetFactory(Syst em.String)
HelpLink: NULL
Source: System.Web
StackTrace Information
*************** *************** ***************
at System.Web.Conf iguration.HttpC onfigurationRec ord.GetFactory( String
configKey)
at System.Web.Conf iguration.HttpC onfigurationRec ord.Evaluate(St ring
configKey, SectionRecord section)
at System.Web.Conf iguration.HttpC onfigurationRec ord.GetConfig(S tring
configKey, Boolean cacheResult)
at System.Web.Conf iguration.HttpC onfigurationRec ord.GetConfig(S tring
configKey, Boolean cacheResult)
at System.Web.Conf iguration.HttpC onfigurationRec ord.GetConfig(S tring
configKey, Boolean cacheResult)
at System.Web.Http Context.GetConf ig(String name)
at
System.Web.Conf iguration.HttpC onfigurationSys temBase.System. Configuration.I C
onfigurationSys tem.GetConfig(S tring configKey)
at System.Configur ation.Configura tionSettings.Ge tConfig(String
sectionName)
at
Microsoft.Appli cationBlocks.Ex ceptionManageme nt.ExceptionMan ager.Publish(Ex c
eption exception, NameValueCollec tion additionalInfo)
2) Exception Information
*************** *************** ***************
Exception Type: System.IO.FileN otFoundExceptio n
Message: File or assembly name
Microsoft.Appli cationBlocks.Ex ceptionManageme nt, or one of its dependencies,
was not found.
FileName: Microsoft.Appli cationBlocks.Ex ceptionManageme nt
FusionLog: === Pre-bind state information ===
LOG: DisplayName = Microsoft.Appli cationBlocks.Ex ceptionManageme nt
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/lrwintranet
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.Appli cationBlocks.Ex ceptionManageme nt
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/lrwintranet/2701740a/e67690c7/Microsoft.Appli cationBlocks.Ex ceptionMan
agement.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/lrwintranet/2701740a/e67690c7/Microsoft.Appli cationBlocks.Ex ceptionMan
agement/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/lrwintranet/bin/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/lrwintranet/bin/Microsoft.Appli cationBlocks.Ex ceptionManageme nt/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/lrwintranet/2701740a/e67690c7/Microsoft.Appli cationBlocks.Ex ceptionMan
agement.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/lrwintranet/2701740a/e67690c7/Microsoft.Appli cationBlocks.Ex ceptionMan
agement/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.EXE.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/lrwintranet/bin/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.EXE.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/lrwintranet/bin/Microsoft.Appli cationBlocks.Ex ceptionManageme nt/Microsoft.Appli cationBlocks.Ex ceptionManageme nt.EXE.
TargetSite: System.Type GetType(System. String, Boolean)
HelpLink: NULL
Source: mscorlib
StackTrace Information
*************** *************** ***************
at System.Type.Get Type(String typeName, Boolean throwOnError)
at System.Web.Conf iguration.HttpC onfigurationRec ord.GetFactory( String
configKey)
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.