title: Upgrading to NServiceBus 3.2.2 exception when starting endpoint
body: <p>I recently upgraded my publisher/subscriber solution to NServiceBus version 3.2.2 using Nuget.  My NServiceBus publisher and subscriber are both self-hosted.</p>
  
  <p>Publisher code:</p>
  
  <p>I start the NServiceBus publisher using NServiceBus.Host.exe (debug start action - start external program in project property).</p>
  
  <p>app.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig,  NServiceBus.Core" /&gt;
      &lt;section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" /&gt;
      &lt;section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" /&gt;
    &lt;/configSections&gt;
    &lt;MsmqTransportConfig ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" /&gt;
    &lt;UnicastBusConfig ForwardReceivedMessagesTo=""&gt;
      &lt;MessageEndpointMappings&gt;&lt;/MessageEndpointMappings&gt;
    &lt;/UnicastBusConfig&gt;
    &lt;MessageForwardingInCaseOfFaultConfig ErrorQueue="error" /&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>EndpointConfig.cs:</p>
  
  <pre><code>namespace TrackEventPublisher.EventPublisher
  {
     [EndpointName("EventPublisher")]
     public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher
     {
     }
  }
  </code></pre>
  
  <p>I ran into the following error when running the publisher:</p>
  
  <p>Exception when starting endpoint, error has been logged. Reason: An exception was thrown while invoking the constructor 'Void .ctor(Raven.Client.IDocumentStore)' on type 'RavenTimeoutPersistence'.</p>
  
  <p>StackTrace:</p>
  
  <p>at NServiceBus.Hosting.GenericHost.Start() in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting\GenericHost.cs:line 45
     at NServiceBus.Hosting.Windows.WindowsHost.Start() in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs:line 56
     at NServiceBus.Hosting.Windows.Program.&lt;>c_<em>DisplayClass8.b</em>_4(WindowsHost service) in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 95
     at Topshelf.Internal.ControllerDelegates<code>1.StartActionObject(Object obj) in d:\dev\open-source\topshelf\src\Topshelf\Internal\ControllerDelegates.cs:line 18
     at Topshelf.Internal.IsolatedServiceControllerWrapper</code>1.&lt;>c_<em>DisplayClass2.b</em>_1(TService service) in d:\dev\open-source\topshelf\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 65
     at Topshelf.Internal.ServiceController<code>1.&lt;.cctor&gt;b__1(ServiceController</code>1 sc) in d:\dev\open-source\topshelf\src\Topshelf\Internal\ServiceController.cs:line 35
     at Magnum.StateMachine.LambdaAction<code>1.Execute(T instance, Event event, Object parameter) in :line 0
     at Magnum.StateMachine.EventActionList</code>1.Execute(T stateMachine, Event event, Object parameter) in :line 0</p>
  
  <p>What might cause this error?<br>
  Can anyone tell me what is wrong with my endpoint configuration?</p>
  
  <p>My solution worked great with an earlier version of NServiceBus (pre version 3.0).</p>
  
  <p><strong>Update</strong>:
  Here is the inner exception message:  "Unable to connect to the remote server"</p>
  
  <p>Is the Raven server started automatically by NServiceBus?  It would appear that it is not running on my machine...</p>
  
  <p><strong>Update</strong>
  Well, for some reason the RavenDB service was not running on my machine - although it is set to start automatically. My solution is working correctly now.  I guess I had to learn about the RavenDB the hard way :).</p>
  
  <p>Has anyone out there had problems running the RavenDB service?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Now that I have my service up and running, I try and run it on a different machine.  The msmq folders are not created, and I get an error that the RavenDB is not available. In fact, RavenDB service is not installed after I ran my solution on a different windows OS machine.  I tried running the "RunMeFirst.bat" that posted with version 3.2.2.  However, the bat file attempts to install an extension with visual studio.  Another error is posted if visual studio is installed, but Nuget extension is not installed.  </p>
  
  <p>Is there a better way to enable NServiceBus.Host.exe to install the RavenDB server and msmq folders without an instance of visual studio installed on the Windows OS machine?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Wow, most updates ever!  I added the following class to my publisher project which successfully created the msmq folders:</p>
  
  <pre><code>   class MsmqTransportConfigOverride : IWantCustomInitialization, INeedToInstallInfrastructure&lt;Windows&gt;
     {
        public void Init()
        {
         Configure.Instance.ForInstallationOn&lt;NServiceBus.Installation.Environments.Windows&gt;().Install();
        }
  
        public void Install(System.Security.Principal.WindowsIdentity identity)
        {
        }
     }
  </code></pre>
  
  <p>This new class which implements the IWantCustomIntialization interface seems to work great.  However, I am still struggling to update my publisher to install the RavenDB on the windows host machine.  I know there is a commandline prompt out there that can facilitate this, but is there another way?  I tried to implement INeedToInstallInfrastructure interface, but I cannot find any examples out there. Does anyone have any ideas?</p>