0

Using Cecil, I'm modifying an assembly for a certain project to include a few extra interfaces. This is triggered from an AfterBuild target in my project file, which calls a custom task. This works fine. The resulting assembly is modified just as it should be.

However, I have another project with a dependency to the one whose assembly is being modified. While working in a Visual Studio 2013 code editor, Visual Studio doesn't seem to pick up on my generated types at all, even though builds work just fine.

I have tried referencing the generated assembly directly rather than the project, but the result is the same. Somehow the editor doesn't see what the build is seeing.

What might be causing this? How do I get the editor to pick up on these types?

Edit: It looks like the problem isn't visual studio itself, but resharper. When I suspend resharper, the editor no longer shows any red symbols nor does it complain about unresolved symbols.

So now the question is, how do I get resharper to pick up on my generated types?

matko
  • 134
  • 6
  • try `Project->Clean`or remove dlls from bin folder, and then rebuild, possibly VS used old verion dll that was copied to local – Grundy Aug 14 '14 at 10:08
  • Cleaning didn't work unfortunately. Also, supposing the issue were a stale dll, the build should fail too, but the build works just fine. It's just the editor that isn't seeing my types. – matko Aug 14 '14 at 10:11

3 Answers3

1

If the modified assembly's project is loaded in the current solution, ReSharper will use the source code to provide symbols, and so it won't see the generated interfaces. If the project isn't included, and the assembly is just a simple file reference, then ReSharper will pick up the symbols from the assembly's IL + metadata, in which case, the generated interfaces should be visible.

citizenmatt
  • 18,085
  • 5
  • 55
  • 60
1

I’ve just encountered the same problem. Here is the issue reported in Jetbrain’s forum:

ReSharper IntelliSense ANTLR support

And in the comments, you can find the solution: an extension to Resharper called External Code.

This works for me. Although after every build VS asks whether to reload the (generated) source that was modified outside of VS which is a little inconvenient.

toderik
  • 479
  • 4
  • 8
0

If Resharper is getting confused then you can try clearing the caches: Resharper->Options...->Environment->General and click the Clear Caches button.

Piers Myers
  • 10,611
  • 6
  • 46
  • 61
  • Unfortunately this didn't solve the problem. Resharper doesn't seem to be getting confused. Rather it is looking in the wrong place, namely the source rather than the built assembly. – matko Aug 14 '14 at 13:06