Enterprise Library 6 logging use msmqdistributor service

Topics: Logging Application Block
Jul 4, 2014 at 5:12 AM
Hello, I had a success project before using EL5.0 to log to MSMQ, then write the message to local Sql DB from MSMQ. I am now trying to migrate it to EL6 also .Net from 4.0 to 4.5, and I find that it does not work using the previous version of dlls which at "C:\Program Files (x86)\Microsoft Enterprise Library 5.0". (after I add my dll to that folder, and the customer trace listener to MsmqDistributor.exe.config, the distributor service fails to launch, with the error message:
Message: An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Core.Logging' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. (C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin\MsmqDistributor.exe.Config line 7)

I remember the above folder is installed when I select the checkbox of build of "Enterprise Library 5.0 - Source Code.msi". Does EL6 still provides the same way to install the distributor service?
Jul 6, 2014 at 4:23 PM
The Enterprise Library 6 download includes the MsmqDistributor.exe which can then be installed in any location you wish. You will also need to modify and recompile any custom trace listeners against Enterprise Library 6.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jul 7, 2014 at 9:17 AM
Thanks for your help!
I find MsmqDistributor.exe at source folder "\Blocks\bin\Debug" and installed it via Visual Studio command prompt. It works well now.
Jul 7, 2014 at 6:05 PM
i have another question about PublicKeyToken.
All the entlib dlls from Nuget have the key token(which are not null). But the dlls i build using the Enterprise Library 6 code don't have the key token(which are null). For the msmqdistributor service, i have to replace all the dlls which i get from Nuget to the ones don't have public key token in my own solution, then i copy my built dlls to the msmqdistributor service folder, and the service works well.
I want to know why the EntLib code don't have the public key token? and are there any good ways to build the dlls without replacing the enterprise library dlls?

Thanks
Tony
Jul 7, 2014 at 9:55 PM
It looks like you are using a custom build from source code (i.e. \Blocks\bin\Debug). When you build from source the PublicKeyToken will be null unless you sign the assemblies yourself.

Do you need a custom Enterprise Library build? if not then download and use the signed binaries. All applications targeting the new distributor service will have to be changed to reference the new Enterprise Library 6 assemblies (including any custom trace listeners you may have). You may also have to perform some migration tasks for those applications.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jul 14, 2014 at 10:13 AM
How to sign the assembly with Public Key Token? I looked into the Project Property, did not find any place to set it.

And, i did not find the signed binaries from the download site of "Enterprise Library 6 download", could you please give me a hint?

Thanks
Tony
Jul 15, 2014 at 6:14 AM
For information on signing assemblies see How to: Sign an Assembly with a Strong Name or Managing Assembly and Manifest Signing.

To get the binaries go to: Microsoft Enterprise Library 6 in the Download Center. Click "Download" and select EnterpriseLibrary6-binaries.exe. Click Next and then run the downloaded EnterpriseLibrary6-binaries.exe to extract. Then open a command prompt and run "powershell -File .\install-packages.ps1" to download all the assemblies from NuGet. You could also take a look at my blog posting: Enterprise Library 6: Installation and VS2012 Configuration which has more details and some pictures.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to