ReSharper 未在 EndpointConfig.cs 中链接到 NServiceBus 主机

ReSharper not linked in EndpointConfig.cs for NServiceBus host

显然

Alt+Enter 在查看由 NServiceBus 主机生成的 EndpointConfig.cs 文件时不起作用。

Ctrl+;, 顺便说一下...

我想做什么

我需要对 classinterface 的引用,它们存在于不同的命名空间中,之前尚未引用。我希望能够使用 ReSharper。

症状

class和接口名称都用红色波浪线下划线,但不是用红色书写:

应该是:

在任何其他文件中,这不是 EndpointConfig.cs,ReSharper 正常工作,只是不在这个特定文件中。

如果我将 EndpointConfig.cs 重命名为其他名称,一切都会按预期进行。

这就像 ReSharper 被硬连接到 not touch EndpointConfig.cs.

What's going on?

PS: EndpointConfig.cs是添加NServiceBus host时自动生成的

ReSharper 不扫描作为 nuget 的一部分提供的文件。当您重命名文件时,ReSharper 不再检测到它是从 nuget 发送的,因此它开始正确扫描该文件。我不知道是否可以改变这种行为。

我可以建议的最佳选择是 self hosting NServiceBus in a windows service. Here is a runnable sample