Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

Run NServiceBus generic host as 32bit process on 64bit machine September 7, 2010

Filed under: Error,NServiceBus,Systems Administration — Rupert Bates @ 3:37 pm

I recently encountered the following error when deploying a service in the NServiceBus generic host (NServiceBus.Host.exe) on a 64bit machine,


System.InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.

It turns out that this is actually a symptom of a problem which can show itself in a number of ways and is caused by running a service which depends on a 32bit dll (in this case the Microsoft Jet drivers) on a 64bit system in the generic host.

To fix it you can create a version of the generic host which is configured to run as 32bit as follows:

Run a visual studio command prompt and cd to the directory where NServiceBus.Host.exe is.  You will also need the NServiceBus.snk file from the NServiceBus download in the same directory so that you can resign the assembly after configuring it

At the command prompt type:

corflags /32BIT+ /Force NServiceBus.Host.exe

sn -R NserviceBus.Host.exe NServiceBus.snk

You can now deploy this version of the host onto your 64bit server and services which use it will run in 32bit mode

Advertisements
 

3 Responses to “Run NServiceBus generic host as 32bit process on 64bit machine”

  1. mac Says:

    Where can i find the .snk file?

    cheers!

  2. mac Says:

    ah it wasn’t on the on the latest .net 4.0 build

  3. Jay Ragsdale Says:

    To be specific, the .snk file is only in the version 1.9 download. This should be fixed in the 3.0 release, according to this article: http://blog.jonathanoliver.com/2011/03/new-nservicebus-feature-32-bit-x86-host-process/


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s