There is a nice example at (https://github.com/0xd4d/dnlib/blob/master/Examples/Example3.cs) where an assembly is created using dnlib. How do I add a DLL reference in this example? What I've failed so far is that I need to create an AssemblyRef, but how to add this AssemblyRef as a reference in the example I can't find anywhere. Does anyone know?
AssemblyDef assembly = AssemblyDef.Load("MyDll.dll");
AssemblyRef assemblyRef = assembly.ToAssemblyRef();
module.GetAssemblyRefs().Add(assenblyRef); //<- Unfortunately this is not working.