I've been trying for hours on finding a way to save a dynamic Assembly (I have access to the assembly - it is of the type 'Assembly'). Also, I do not have access to the byte array of the assembly. I've also looked around StackOverflow, but this search did not yield successful results.
For clarification:
// the assembly (this is an example)
Assembly asm = SomeMethod(); // returns a valid result
// now how would I go about saving to disk?
Is it possible to save the an assembly of type Assembly?
If so, how would I proceed to accomplish this?
Thanks in advance.
For people commenting "possible duplicate": This is a duplicate, but with valid reason: the answers on other threads do not work - this is an attempt to revive a topic with low-quality answers.
This will not work because the answer does not instantiate "results" and therefore I cannot replicate the solution.
AssemblyBuilder.Save() will not work because supposedly C# "cannot cast type AssemblyBuilder to type Assembly", even though some of the other answers on here include this as a solution.