MsmqDistributor.exe issue

Topics: Logging Application Block
May 8, 2010 at 8:33 AM

I created a custom TraceListener with Enterprise Library 4.1, then I modify MsmqDistributor.exe.config to use my created TraceListener, After I start Enterprise Library Distributor Service, it will show following error in event log: Could not load file or assembly 'Test' or one of its dependencies.

My Test project is used .net framework 4.0. When I switch it to 3.5, that service can work. Any solution can work under .net framework 4.0 with MsmqDistributor.exe?

 

May 11, 2010 at 12:30 AM

You should deploy the custom trace listener assembly (I'm guessing it's the Test assembly) and all other custom assemblies you referred to in the MsqmDistributor.exe.config to the same location where the MsmqDistributor.exe is in.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com

May 11, 2010 at 3:02 PM

Thanks for your reply. I think it doesn't matter with deployment issue. Because when I set project's target framework as 3.5, the service can start. Once I set project's targ framework as 4.0, the service can not start and throw that exception in EventLog.

May 12, 2010 at 2:34 AM

Yes, sorry, I guess I immediately jumped to conclusion when I saw the error message.  The problem is the MsmqDistributor was built targeting .net framework 3.5.  If I'm not mistaken, you can reference an assembly using a lower version of .net framework but you can't do it the other way.  I was able to repro your error and the error message also includes this - "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."  I'm not sure if there's an easier workaround for this but what I can suggest right now is to build the Logging.MsmqDistributor project targeting the .NET Framework 4.0.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com