2013-10-09 66 views
1

我有以下EndpointConfig.csNServiceBus SatelliteLauncher例外

public class EndpointConfig : IConfigureThisEndpoint, IWantCustomInitialization, AsA_Server 
{ 
    public void Init() 
    { 
     Configure 
      .With(GetAllAssemblies()) 
      .XmlSerializer() 
      .UseTransport<SqlServer>() 
      .DefaultBuilder() 
      .UseNHibernateSubscriptionPersister() 
      .UseNHibernateTimeoutPersister() 
      .UseNHibernateSagaPersister() 
      .UseNHibernateGatewayPersister() 
      .UnicastBus() 
      .PurgeOnStartup(false); 
    } 
} 

而且我得到以下異常:

2013-10-09 16:15:40,780 [16] ERROR NServiceBus.Satellites.SatelliteLauncher [(null)] <(null)> - Satellite NServiceBus.Gateway.Receiving.GatewayReceiver, NServiceBus.Core, Version=4.0.0.0, Culture=neutral,  PublicKeyToken=9fc386479f8a226c 
System.Exception: Failed to start listener for http://localhost/NserviceBus/ make sure that you have admin privileges ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process 
    at System.Net.HttpListener.AddAllPrefixes() 
    at System.Net.HttpListener.Start() 
    at NServiceBus.Gateway.Channels.Http.HttpChannelReceiver.Start(String address, Int32 numWorkerThreads) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Gateway\Channels\Http\HttpChannelReceiver.cs:line 36 
    --- End of inner exception stack trace --- 
    at NServiceBus.Gateway.Channels.Http.HttpChannelReceiver.Start(String address, Int32 numWorkerThreads) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Gateway\Channels\Http\HttpChannelReceiver.cs:line 40 
    at NServiceBus.Gateway.Receiving.IdempotentChannelReceiver.Start(Channel channel, Int32 numWorkerThreads) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Gateway\Receiving\IdempotentChannelReceiver.cs:line 34 
    at NServiceBus.Gateway.Receiving.GatewayReceiver.Start() in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Gateway\Receiving\GatewayReceiver.cs:line 71 
    at NServiceBus.Satellites.SatelliteLauncher.StartSatellite(SatelliteContext ctx) in c:\BuildAgent\work\d4de8921a0aabf04\src\NServiceBus.Core\Satellites\SatelliteLauncher.cs:line 107 

任何想法?

感謝

+0

您是在Visual Studio中運行還是在生產中出現此問題?最簡單的解決方法是以管理員身份運行VS。否則谷歌NETSH HTTP添加URLACL –

+0

當我從VS運行它時發生,但我用管理員權限運行它。謝謝 – Marco

回答

0

您的意思是使網關組件?
如果沒有,請刪除.UseNHibernateGatewayPersister()

潛在問題與NServiceBus無關。您正在運行Visual Studio的帳戶不具有保留HTTP/S端口的權限。當自行託管WCF端點時會發生同樣的事情。

有關MSDN的更多信息

+0

我剛剛從一個例子中複製了它,我仍然使用它到版本4,最後我使用的是2.6。=,所以有很多想法。但是,既然你觸摸了這個網關組件的全部內容? – Marco

+0

我剛剛刪除了這個,並沒有顯示異常,但我很想知道這個網關的東西是什麼? – Marco

+0

http://support.nservicebus.com/customer/portal/articles/859548-the-gateway-and-multi-site-distribution –