'Can I perform a partial compilation to get class metadata?

I have a project where I am mining metadata, specifically attributes and custom xml documentation comments, from a particular dll that is created in another C# project. The mining is aimed at finding all methods with particular attributes and/or documentation comments in the dll. I use Assembly.LoadFrom and GetTypes (and additional processing) to find all of the attributes, and I parse the generated XML documentation file to access the custom documentation comments. I have the functionality working fine, but there is a lot of extra overhead needed to get things to work.

The project being mined does not need to execute, but needs to be compiled in order to have a dll from which I can extract the attributes and to generate the XML document. Unfortunately, this target project depends, directly or indirectly, on 10 other projects. These additional projects provide exactly zero benefit other than allowing the target project to compile. But I have to pull these additional 10 projects into my solution just because.

Is it possible to perform some sort of partial compilation of the project in question without having the projects upon which it depends in the solution? Can I get the type information (from which I mine attributes) and the XML documentation some other way?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source