In our project we use a lot of T4 code generation. We use an ORM called DataObjects.Net of X-Tensive. We have a bit a chicken-egg problem. We need to compile the classes of the ORM before we can use the assembly's metadata to generate code. Then when the code is generated we can compile the model again but now in combination with generated code (partial classes). Most of the custom code in the model classes can not be compiled without the generated code.
How we solved it is to have a separate configuration in VS2013 called 'Model'. In this configuration a 'Conditional compilation symbol' call 'JUSTMODEL' is present. All code that does not compile without the generated code is placed between #if !JUSTMODEL #endif compiler directives which causes this code not be compiled for the 'Model' configuration.
This is a bit tedious. We have created a little extensiblity application that automates this proces but it more and more becomes pretty time consuming to run the proces.
Now I was wondering if it is possible to get the metadata of the Model assembly without building the assembly via an extensibility API of some kind. I see lots of tools in Visual Studio that understand classes loaded in the editors and give me some feedback (like intellisense).