NServiceBus 抛出远程服务器返回错误:(404) Not Found [英] NServiceBus throws The remote server returned an error: (404) Not Found

查看:109
本文介绍了NServiceBus 抛出远程服务器返回错误:(404) Not Found的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用简单的配置来运行使用 NServiceBus 的发布/订阅方案.

I use simple a configuration to run a Publish/Subscribe scenario using NServiceBus.

我收到此异常:

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

这不是致命的,它是在 NServiceBus/RavenDb 代码中的某个地方处理的,但我想知道为什么会发生这种情况.仅当我在异常"窗口中为公共语言运行时异常"选择抛出"选项时才看到它.

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.

推荐答案

我建议添加 Log4Net(最简单的是通过 Visual Studio 包管理器),然后告诉 NServiceBus 在配置总线时它应该使用 log4net:

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() //...

您会发现 NServiceBus 记录了大量日志(无论是到 NServiceBus 主机的控制台窗口,还是到 Visual Studio 调试器窗口),并且很可能包含发生 404 的原因.

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.

这篇关于NServiceBus 抛出远程服务器返回错误:(404) Not Found的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆