0

I'm wondering if such a thing is possible. Let's say I have an existing DLL of a few classes, and I want to compile it with either a new class in the existing DLL, or update an existing class. I know that Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create can handle multiple SyntaxTrees, I'm just wondering if those can be obtained from existing Types from a DLL somehow?

John Ernest
  • 785
  • 1
  • 8
  • 20
  • 1
    The question title says that you want a decompiler. The question body says that you want to add an assembly reference. No, yes. – Hans Passant Jul 19 '18 at 10:49
  • Thanks I updated the title to clarify a bit. Except my question now though is, can I compile to the same DLL, which in this case doesn't seem like it would be a reference, extracting the existing classes and updating them and/or adding new classes with Roslyn? – John Ernest Jul 19 '18 at 17:48
  • By the way the context of usage in this, is that I'm building a tool for developers to make their own runtime code-first classes for a database implementation. I can right now give them the source code as a string to the table they want to build, and even compile it to a new DLL, what I'm unsure of is if I can compile it into an existing DLL so that they can keep a collection of runtime built code-first classes. – John Ernest Jul 19 '18 at 17:51

0 Answers0