I hope you'll indulge the length of this post. I'm looking into
incorporating the Exception Management Application Block (EMAB) and the
Logging Block into my future applications. The latter includes the
Enterprise Instrumentation Framework Publisher for EMAB. I noticed that
when I built the Logging Block's sample, EIFPublisherSample, it's
app.config file referenced the custom publisher
Microsoft.ApplicationBlocks.Logging.EIFPublisher.
But this assembly did not appear to be built by the Logging solution.
It seemed to be in a separate solution -- EMABLoggins.sln.
When you build the first solution, it puts
Microsoft.ApplicationBlocks.Common.dll
Microsoft.ApplicationBlocks.Logging.Schema.dll
Microsoft.ApplicationBlocks.Logging.EventSinks.dll
Microsoft.ApplicationBlocks.Logging.WseCustomFilters.MeteringOutputFilte
r.dll
Microsoft.ApplicationBlocks.Logging.WseCustomFilters.RequestTracingFilte
r.dll
into C:\Program Files\Microsoft Application Blocks for .NET\Logging
\Logging\bin\Release
The second solution dumped in
Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.dll
Microsoft.ApplicationBlocks.ExceptionManagement.dll
Microsoft.ApplicationBlocks.Logging.EIFPublisher.dll
The instructions indicate creating a key file, logging.snk, in C:
\Program Files\Microsoft Application Blocks for .NET\Logging\Logging\bin
These appear to be used by only the first solution, not the second. And
the instructions reference the use of regschema.cmd and regsinks.cmd to
install
Microsoft.ApplicationBlocks.Logging.Schema.dll
Microsoft.ApplicationBlocks.Logging.EventSinks.dll
in the GAC.
As I mentioned, when I built the Logging Block's sample,
EIFPublisherSample, it's app.config file referenced the custom publisher
Microsoft.ApplicationBlocks.Logging.EIFPublisher. But unless I copied
this assembly into the sample's project folder, it was not found by the
EMAB's code. Indeed I found a CustomPublisherException in the event log
indicating it could not find the custom publisher.
Questions:
When the app.config file's publisher line references the custom
publisher as with:
<publisher assembly="Microsoft.ApplicationBlocks.Logging.EIFPublisher"
type="Microsoft.ApplicationBlocks.Logging.EIFPublisher.EIFExceptionPubli
sher" exclude="*"
include="Microsoft.ApplicationBlocks.Logging.Samples.LogonException,
EIFPublisherSample;"/>
where does it look? In the standard assembly locations -- the executing
assemblies root and descendants along with the GAC?
- Should I put the Microsoft.ApplicationBlocks.Logging.EIFPublisher
assembly in the GAC?
- If so, should it be signed with the same keyfile (logging.snk)?
- Can multiple assemblies be signed with the same key pair? Out of
curiosity, when is this desireable or not?
- Why is it that only the Schema and EventSinks assemblies got put in
the GAC. Why not Common and the two WseCustomFilter assemblies.
I'm sorry if I'm a bit naive about these issues. Right now I'm
concentrating on putting together a proper build environment for using
these two application blocks on my development machine.
TIA
John Eikanger [MSFT] - 17 Mar 2004 23:51 GMT
Hi, Howard
I'm in the process of finding someone with expertise in this area.
Thank you for your patience
John Eikanger
Microsoft Developer Support
Howard Pinsley - 18 Mar 2004 21:59 GMT
> Hi, Howard
>
[quoted text clipped - 4 lines]
> John Eikanger
> Microsoft Developer Support
Thank you, John.
Barath Vasudevan [MS] - 19 Mar 2004 00:00 GMT
Hi Howard,
Logging Application Block and EMAB are not my forte. But I'll try to answer
some of the questions; you may however want to contact the
devfdbck@microsoft.com for questions about Application Blocks.
To use the EIF Publisher for EMAB, you'll have to use the EMABLogging.Sln
and not the Logging.Sln. So, you could have run into the "Referencing"
issue because of that.
To answer the questions:
Here's a link that describes how the CLR locates the assemblies during
runtime:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconhowruntimelocatesassemblies.asp
From my understanding of the EMAB, you dont need to put the EIFPublisher in
the GAC. But you do need to register this publisher's identity with the
EMAB, by adding the <publisher .....> element in any one of the xml
configuration files, namely
machine.config or web.config or application.exe.config or app.config.
More info is available in the EMAB documentation
Yes, multiple assemblies can be signed with the same key pair. But I'm not
sure if it is recommended or if and when it would desirable.
As for the WseCustomFilters not being added to the GAC, i'm not sure why
but I'll look into it and update you.
Thx
Barath
This posting is provided "As Is" with no warranties, and confers no
rights.Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
>From: Howard Pinsley <hpinsley@kayescholer.com>
>Subject: Not sure how to use the EIF Publisher for EMAB
[quoted text clipped - 88 lines]
>
>TIA
Tom Hollander [MSFT] - 20 Mar 2004 01:55 GMT
Hi Howard -
Most of these questions do not relate specifically to the EIF or Application
Blocks, they are more about how .NET locates assemblies at runtime.
It's really up to you whether you put the assemblies into the GAC - there
are pros and cons to doing so. Putting assemblies into the GAC is useful if
you want to share them amongst many applications and don't want to manage
many copies of the file. Keeping private copies of assemblies is generally
best if they aren't shared across many applications or if you want to choose
different versions for different applications. As you've found out, you need
to give a strong name to any assemblies that you want to put in the GAC.
There is nothing wrong with signing multiple assemblies with the same
keypair - you'll normally use a single keypair for all assemblies in a large
project.
If you have configuration files that specify type names (such as those used
by EMAB and EIF to load providers/publishers), you can either use a
fully-qualified type name (including Version, PublicKeyToken and Culture
after the assembly name) or a partially-qualified type name (by omiting
these details). In the sample config below you have a partially-qualified
typename.
When you use a fully-qualified typename, .NET will first look in the GAC,
and if it isn't there, it will look in your application's private directory
(and in any probing paths, if you've set them). If you have a
partially-qualified typename, .NET will _only_ look in the app's private
directory (and probing paths), never in the GAC.
So, to answer the question, if you choose to put the assemblies in the GAC,
you need to update the config files to use fully-qualified typenames.
Alternatively you can copy all the necessary assemblies into your app's
executable path (in which case you can have either partially- or
fully-qualified types in the config). You can also decide to put some
assemblies in the GAC and have some in private directories, just so long as
you have fully-qualified types for anything loaded from the GAC.
BTW - we are working hard to make sure that future Application Blocks and
their samples are much easier to use! :-)
Hope this helps
Tom Hollander
Microsoft patterns & practices
> I hope you'll indulge the length of this post. I'm looking into
> incorporating the Exception Management Application Block (EMAB) and the
[quoted text clipped - 75 lines]
>
> TIA