问题
I use simple a configuration to run a Publish/Subscribe scenario using NServiceBus.
I'm getting this exception:
The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getResponse) in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 332
It's not a fatal one, it's handled somewhere in NServiceBus/RavenDb code, but I wonder why it's happening. I see it only when I select "Thrown" option for "Common Language Runtime Exceptions" in Exceptions window.
回答1:
I would recommend adding Log4Net (easiest is through the Visual Studio Package manager), and then telling NServiceBus that it should use log4net when configuring the Bus:
Bus = Configure.With()
.Log4Net()
.DefaultBuilder() //...
You'll find that NServiceBus logs plenty (either to the Console window of the NServiceBus host, or to the Visual Studio debugger window), and it's very likely to contain the reason why that 404 occurs.
来源:https://stackoverflow.com/questions/20676908/nservicebus-throws-the-remote-server-returned-an-error-404-not-found