1

I realize that this is slightly backwards, but I am trying to read create a Roslyn Compilation object from a previously generated C# NuGet package. I cannot find any obvious way to achieve this.

My use case is that I want to compare the syntax trees of some package in a feed to the syntax trees in a new compilation. I know that the NuGet contains the DLL I need, and I have the current source code to create my new compilation, but the act of generating a compilation with syntax trees from an existing DLL is not something I have come across in the docs. Is it possible and if so how?

UndyingJellyfish
  • 194
  • 2
  • 15
  • The syntax trees are not persisted in any way to the binaries. The best you can do is, if the NuGet packages has information on the origin of the source code, build it and compare the binaries. – Paulo Morgado Aug 09 '22 at 11:22
  • I fortunately have provenance data from the NuGet specifying the repo and commit hash. Guess I'll go with that solution instead. – UndyingJellyfish Aug 10 '22 at 12:37

0 Answers0