0

Apparently

Alt+Enter does not work when viewing the EndpointConfig.cs file, generated by NServiceBus host.

Neither does Ctrl+;, by the way ...

What I'm trying to do

I need a reference to a class and interface that exist in different namespaces, not yet referenced previously. I would like to be able to use ReSharper.

Symptoms

Both the class and interface names are underlined with the red wavey line, but are not written in red:

enter image description here

That should be:

enter image description here

In any other file, that's not EndpointConfig.cs, ReSharper works as normal, just not in this particular file.

If I rename EndpointConfig.cs to something else, everything works as expected.

It's like ReSharper is hardwired to not touch EndpointConfig.cs.

What's going on?

PS: EndpointConfig.cs is auto-generated when adding NServiceBus host.

Spikee
  • 3,967
  • 7
  • 35
  • 68
  • 1
    Does it compile? – tom redfern Mar 06 '17 at 14:32
  • Compiles and runs as expected. – Spikee Mar 06 '17 at 14:41
  • 2
    This is not a NSB problem it's a ReSharper problem. I have had this before. It gets confused sometimes. You should be able to clear the reference cache to fix this. Look here: http://stackoverflow.com/questions/9799074/how-to-make-resharper-re-evaluate-its-assembly-reference-highlighting – tom redfern Mar 06 '17 at 14:56
  • Possible duplicate of [How to make resharper re-evaluate its assembly reference highlighting](http://stackoverflow.com/questions/9799074/how-to-make-resharper-re-evaluate-its-assembly-reference-highlighting) – tom redfern Mar 06 '17 at 16:39

1 Answers1

1

ReSharper does not scan files that are shipped as part of a nuget. When you rename the file ReSharper no longer detects that it was shipped from the nuget hence it starts properly scanning that file. I do not know if it possible to change this behavior.

The best alternative I can suggest is self hosting NServiceBus in a windows service. Here is a runnable sample.

Simon
  • 33,714
  • 21
  • 133
  • 202