G
Guest
I'm trying to set up a custome e-mail publisher for a web app using the
Microsoft Exception Management Application Block for .NET sample app.
Our app already uses the Exception Management Block, but with the default
publishing to the Event Log. We have an error handler
Intranet_Exception_Processing.Vb in the app's Component folder with the
ExceptionManager.Publish(ex) call.
Here is the code generating the error:
ExceptionManager.VB (straight from the sample app):
Private Shared Function Activate(ByVal [assembly] As String, ByVal typeName
As String) As Object
Return AppDomain.CurrentDomain.
CreateInstanceAndUnwrap([assembly], typeName)
End Function
and the error:
"Could not load type IntranetPlus.ExceptionPublisher from assembly
intranetplus, Version=1.0.2638.14505, Culture=neutral,
PublicKeyToken=null." String
(NOTE: I confirmed the class is defintely there using Class View)
Here's how I implemented the cutsom publisher. Notice I did not modify the
sample app much at all:
1) Added the following Exception Management projects from Microsoft to
the our solution:
a) Microsoft.ApplicationBlocks.ExceptionManagement
b) Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
2) Our App's Main Project
a) Set references to the above new projects
b) Removed the following DLLs from various places and updated the
references to the new Exception Management projects above
i) Microsoft.ApplicationBlocks.ExceptionManagement.dll
ii) Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.dll
c) Removed all "Imports Microsoft.ApplicationBlocks.ExceptionManagement"
and
"Imports intranetplus.Intranet_Exception_Processing" from individual
source
files and added "intranetplus.Intranet_Exception_Processing" (our
handler -
see above) to the project Imports setting.
3) Our App's Components Folder
a) Added the sample app's ExceptionPublisher.vb to folder and our main
project
4) Our Intranet_Exception_Processing.vb error handler
a) Included "Imports Microsoft.ApplicationBlocks.ExceptionManagement".
5) Our Web.Config
a) Added configSections section for ExceptionManagement
<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement" />
</configSections>
b) Added exceptionManagement section
<exceptionManagement>
<publisher mode="on" assembly="IntranetPlus"
type="IntranetPlus.ExceptionPublisher"
fileName="c:\Error.log"
operatorMail="(e-mail address removed)" />
</exceptionManagement>
Microsoft Exception Management Application Block for .NET sample app.
Our app already uses the Exception Management Block, but with the default
publishing to the Event Log. We have an error handler
Intranet_Exception_Processing.Vb in the app's Component folder with the
ExceptionManager.Publish(ex) call.
Here is the code generating the error:
ExceptionManager.VB (straight from the sample app):
Private Shared Function Activate(ByVal [assembly] As String, ByVal typeName
As String) As Object
Return AppDomain.CurrentDomain.
CreateInstanceAndUnwrap([assembly], typeName)
End Function
and the error:
"Could not load type IntranetPlus.ExceptionPublisher from assembly
intranetplus, Version=1.0.2638.14505, Culture=neutral,
PublicKeyToken=null." String
(NOTE: I confirmed the class is defintely there using Class View)
Here's how I implemented the cutsom publisher. Notice I did not modify the
sample app much at all:
1) Added the following Exception Management projects from Microsoft to
the our solution:
a) Microsoft.ApplicationBlocks.ExceptionManagement
b) Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
2) Our App's Main Project
a) Set references to the above new projects
b) Removed the following DLLs from various places and updated the
references to the new Exception Management projects above
i) Microsoft.ApplicationBlocks.ExceptionManagement.dll
ii) Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.dll
c) Removed all "Imports Microsoft.ApplicationBlocks.ExceptionManagement"
and
"Imports intranetplus.Intranet_Exception_Processing" from individual
source
files and added "intranetplus.Intranet_Exception_Processing" (our
handler -
see above) to the project Imports setting.
3) Our App's Components Folder
a) Added the sample app's ExceptionPublisher.vb to folder and our main
project
4) Our Intranet_Exception_Processing.vb error handler
a) Included "Imports Microsoft.ApplicationBlocks.ExceptionManagement".
5) Our Web.Config
a) Added configSections section for ExceptionManagement
<configSections>
<section name="exceptionManagement"
type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement" />
</configSections>
b) Added exceptionManagement section
<exceptionManagement>
<publisher mode="on" assembly="IntranetPlus"
type="IntranetPlus.ExceptionPublisher"
fileName="c:\Error.log"
operatorMail="(e-mail address removed)" />
</exceptionManagement>