title: "No message serializer has been configured" error when starting NServiceBus endpoint
body: <p>My GenericHost hosted service is failing to start with the following message:</p>
  
  <p>2010-05-07 09:13:47,406 [1] FATAL NServiceBus.Host.Internal.GenericHost [(null)] &lt;(null)> - System.InvalidOperationException: No message serializer has been con
  figured.
     at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.CheckConfiguration() in d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Msmq\
  MsmqTransport.cs:line 241
     at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.Start() in d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Msmq\MsmqTransport
  .cs:line 211
     at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start(Action startupAction) in d:\BuildAgent-02\work\672d81652eaca4e1\src\unicast\NServiceBus.Uni
  cast\UnicastBus.cs:line 694
     at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start() in d:\BuildAgent-02\work\672d81652eaca4e1\src\unicast\NServiceBus.Unicast\UnicastBus.cs:l
  ine 665
     at NServiceBus.Host.Internal.GenericHost.Start() in d:\BuildAgent-02\work\672d81652eaca4e1\src\host\NServiceBus.Host\Internal\GenericHost.cs:line 77</p>
  
  <p>My endpoint configuration looks like:</p>
  
  <pre><code>public class ServiceEndpointConfiguration
      : IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization
  {
      public void Init()
      {
          // build out persistence infrastructure
          var sessionFactory = Bootstrapper.InitializePersistence();
  
          // configure NServiceBus infrastructure
          var container = Bootstrapper.BuildDependencies(sessionFactory);
  
          // set up logging
          log4net.Config.XmlConfigurator.Configure();
  
          Configure.With()
              .Log4Net()
              .UnityBuilder(container)
              .XmlSerializer();
      }
  }
  </code></pre>
  
  <p>And my app.config looks like:</p>
  
  <p></p>
  
  <pre><code>&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="Logging" type="NServiceBus.Config.Logging, NServiceBus.Core" /&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" /&gt;
  &lt;/configSections&gt;
  
  &lt;Logging Threshold="DEBUG" /&gt;
  
  &lt;MsmqTransportConfig
      InputQueue="NServiceBus.ServiceInput"
      ErrorQueue="NServiceBus.Errors"
      NumberOfWorkerThreads="1"
      MaxRetries="2" /&gt;
  
  &lt;UnicastBusConfig
      DistributorControlAddress=""
      DistributorDataAddress=""
      ForwardReceivedMessagesTo="NServiceBus.Auditing"&gt;
      &lt;MessageEndpointMappings&gt;
          &lt;!-- publishers don't need to set this for their own message types --&gt;
      &lt;/MessageEndpointMappings&gt;
  &lt;/UnicastBusConfig&gt;
  
  &lt;connectionStrings&gt;
      &lt;add name="Db" connectionString="Data Source=..." providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  
  &lt;log4net debug="true"&gt;
      &lt;root&gt;
          &lt;level value="INFO"/&gt;
      &lt;/root&gt;
      &lt;logger name="NHibernate"&gt;
          &lt;level value="ERROR" /&gt;
      &lt;/logger&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p></p>
  
  <p>This has worked in the past, but seems to be failing when the generic host starts. My endpoint configuration is below, along with the app.config for the service. What is strange is that in my endpoint configuration, I am specifying to use the XmlSerializer for message serialization. I don't see any other errors in the console output preceding the error message. What am I missing?</p>
  
  <p>Thanks, Steve</p>