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_Except ion_Processing. Vb in the app's Component folder with the
ExceptionManage r.Publish(ex) call.
Here is the code generating the error:
ExceptionManage r.VB (straight from the sample app):
Private Shared Function Activate(ByVal [assembly] As String, ByVal typeName
As String) As Object
Return AppDomain.Curre ntDomain.
CreateInstanceA ndUnwrap([assembly], typeName)
End Function
and the error:
"Could not load type IntranetPlus.Ex ceptionPublishe r from assembly
intranetplus, Version=1.0.263 8.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.Appli cationBlocks.Ex ceptionManageme nt
b) Microsoft.Appli cationBlocks.Ex ceptionManageme nt.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.Appli cationBlocks.Ex ceptionManageme nt.dll
ii) Microsoft.Appli cationBlocks.Ex ceptionManageme nt.Interfaces.d ll
c) Removed all "Imports Microsoft.Appli cationBlocks.Ex ceptionManageme nt"
and
"Imports intranetplus.In tranet_Exceptio n_Processing" from individual
source
files and added "intranetplus.I ntranet_Excepti on_Processing" (our
handler -
see above) to the project Imports setting.
3) Our App's Components Folder
a) Added the sample app's ExceptionPublis her.vb to folder and our main
project
4) Our Intranet_Except ion_Processing. vb error handler
a) Included "Imports Microsoft.Appli cationBlocks.Ex ceptionManageme nt".
5) Our Web.Config
a) Added configSections section for ExceptionManage ment
<configSections >
<section name="exception Management"
type="Microsoft .ApplicationBlo cks.ExceptionMa nagement.Except ionManagerSecti onHandler,Micro soft.Applicatio nBlocks.Excepti onManagement" />
</configSections>
b) Added exceptionManage ment section
<exceptionManag ement>
<publisher mode="on" assembly="Intra netPlus"
type="IntranetP lus.ExceptionPu blisher"
fileName="c:\Er ror.log"
operatorMail="a bc123@company.c om" />
</exceptionManage ment>
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_Except ion_Processing. Vb in the app's Component folder with the
ExceptionManage r.Publish(ex) call.
Here is the code generating the error:
ExceptionManage r.VB (straight from the sample app):
Private Shared Function Activate(ByVal [assembly] As String, ByVal typeName
As String) As Object
Return AppDomain.Curre ntDomain.
CreateInstanceA ndUnwrap([assembly], typeName)
End Function
and the error:
"Could not load type IntranetPlus.Ex ceptionPublishe r from assembly
intranetplus, Version=1.0.263 8.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.Appli cationBlocks.Ex ceptionManageme nt
b) Microsoft.Appli cationBlocks.Ex ceptionManageme nt.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.Appli cationBlocks.Ex ceptionManageme nt.dll
ii) Microsoft.Appli cationBlocks.Ex ceptionManageme nt.Interfaces.d ll
c) Removed all "Imports Microsoft.Appli cationBlocks.Ex ceptionManageme nt"
and
"Imports intranetplus.In tranet_Exceptio n_Processing" from individual
source
files and added "intranetplus.I ntranet_Excepti on_Processing" (our
handler -
see above) to the project Imports setting.
3) Our App's Components Folder
a) Added the sample app's ExceptionPublis her.vb to folder and our main
project
4) Our Intranet_Except ion_Processing. vb error handler
a) Included "Imports Microsoft.Appli cationBlocks.Ex ceptionManageme nt".
5) Our Web.Config
a) Added configSections section for ExceptionManage ment
<configSections >
<section name="exception Management"
type="Microsoft .ApplicationBlo cks.ExceptionMa nagement.Except ionManagerSecti onHandler,Micro soft.Applicatio nBlocks.Excepti onManagement" />
</configSections>
b) Added exceptionManage ment section
<exceptionManag ement>
<publisher mode="on" assembly="Intra netPlus"
type="IntranetP lus.ExceptionPu blisher"
fileName="c:\Er ror.log"
operatorMail="a bc123@company.c om" />
</exceptionManage ment>
Comment