NServiceBus 抛出远程服务器返回错误:(404) Not Found

编程入门 行业动态 更新时间:2024-10-24 10:16:59
本文介绍了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

本文发布于:2023-11-16 15:05:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605372.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:抛出   错误   服务器   NServiceBus

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!