473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using Exception Management Application Block in a Web App

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.In terfaces
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.dl l
ii) Microsoft.ApplicationBlocks.ExceptionManagement.In terfaces.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.ExceptionManagem ent.ExceptionManagerSectionHandler,Microsoft.Appli cationBlocks.ExceptionManagement" />
</configSections>
b) Added exceptionManagement section
<exceptionManagement>
<publisher mode="on" assembly="IntranetPlus"
type="IntranetPlus.ExceptionPublisher"
fileName="c:\Error.log"
operatorMail="ab****@company.com" />
</exceptionManagement>
Mar 23 '07 #1
1 2458
Yeah, that happens.

The issue is that you can't "Create Event Log Source" or some permission
like that.

Here is my web.config file:


<exceptionManagement mode="on">

<publisher assembly="CompanyName.Exceptions"
type="CompanyName.Exceptions.CustomPublisherLib.Ex ceptionBaseCustomPublisher
"
exceptionFormat="xml" />

</exceptionManagement>
where
CompanyName.Exceptions.dll is the assembly with the customer publisher.
I'd recommend putting the custom publisher in its own assembly.
PS

I don't think you can just do this:
fileName="c:\Error.log"
operatorMail="ab****@company.com" />
but I might be wrong.

I have these notes in my custom publisher class.

' The section handler interprets and processes the settings defined
in
' XML tags within a specific portion of a Web.config file and
returns an
' appropriate configuration object .... based on the configuration
settings.
' ( above exert from
http://msdn.microsoft.com/library/de...onhandlers.asp )
' also see
http://support.microsoft.com/default...b;en-us;309045 // Article
ID : 309045

"Brett Ossman" <Br*********@discussions.microsoft.comwrote in message
news:06**********************************@microsof t.com...
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.In terfaces
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.dl l
ii) Microsoft.ApplicationBlocks.ExceptionManagement.In terfaces.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.ExceptionManagem ent.ExceptionManagerSectio
nHandler,Microsoft.ApplicationBlocks.ExceptionMana gement" />
</configSections>
b) Added exceptionManagement section
<exceptionManagement>
<publisher mode="on" assembly="IntranetPlus"
type="IntranetPlus.ExceptionPublisher"
fileName="c:\Error.log"
operatorMail="ab****@company.com" />
</exceptionManagement>

Mar 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve O'maley | last post by:
I currently have the Exception Management Application Block working in my base directory, but when I create pages in a subfolder the Exception Management Application Block is never executed. The...
1
by: Abelardo Vacca | last post by:
Hello, Could anyone point out advantages and disadvantages of Apache's Log4net and Microsoft's Exception Management Application Block? I am leaning towards log4net, but I've read it can give...
1
by: Andy | last post by:
Hi All, I'm basically just trying to get started with the Exception Management Application Block and am having some technical difficulties. All I want to do to begin with is create a simple...
2
by: Brad Simon | last post by:
I have seen this problem posted, but the fix posted is not working for me, so I hope to get some help here. I am using the EMAB with all of the default settings, and no custom publisher. It...
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web wervice or in a web application I get the following...
2
by: kendf | last post by:
Hi all, As a beginner, I using .Net SDK v1.1 for command line compilation. I have a problem to compile the source code of MS Exceptional Management Application Block, downloaded from MS...
2
by: alexandre jenny | last post by:
Hi Does someone have already integrated that application block in a project. Is the design of that block good or not ? Usable or not ? I'm just wondering if I go with it or with my own (It's for...
0
by: Florida . NET Coder | last post by:
I am using the EMAB with a custom publisher. Everything works fine when I am using a reference to the debug version of the EMAB but when I use a release version of the EMAB it seems like my custom...
0
by: marsdei | last post by:
<exceptionManagement> <publisher mode="on" Assembly="<AssemblyNameWillGoHere>" type="<AssemblyNameWillGoHere>.MyExceptionEmailPublisher.vb" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.