Intellisense and Error highlighting for Generated code

When I compile a VS project into an assembly and the build process contains tasks that generate source files, the generated classes are not available to ReSharper's intellisense and error highlighting. Several workarounds have been suggested on StackOverflow and on these forums, but none really addresses the problem: using only source files in the solution for error highlighting and intellisense is not enough.

  • Making empty dummy classes in the project is not an option as it a) requires me to know the names of all the generated files/classes, and b) does not really help intellisense/error highlighting, as the classes are empty.
  • Having the generated classes be added to the project automatically at compile time requires modification to the .csproj at compile time. I don't know if this is possible, and if it is I'd love to see a tutorial of how to achieve this.


R# allows using visual studio's functionality, but only on a solution level afaik. At least having the option to exclude individual projects from R# intellisense/highlighting would be beneficial, then I could get R# features where they would work (in any project without generated classes).
For an example issue, see e.g.
http://stackoverflow.com/questions/19616649/antlr4-c-sharp-targets-and-output-path-of-generated-files/19623156#19623156

1 comment
Comment actions Permalink

Do you have a repro that you could share, so I can take a look?

Thanks
Matt

0

Please sign in to leave a comment.