Original Post
Yes I am wondering if it possible to combine a dll and a c# executable into one file.
Quote:
Original post by NoahAdler
If the .dll is a .NET assembly, you can certainly embed it as a resource, and then load it using Assembly.Load(byte[]), which just loads an assembly from a raw COFF image.
-bodisiw
class CoffLoader { private static void OnAssemblyLoad(object o, AssemblyLoadEventArgs args) { Console.WriteLine("Loaded assembly {0}", args.LoadedAssembly); } public static void Main() { Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CoffAssembly.dll"); byte[] coffImage = new byte[stream.Length]; stream.Read(coffImage, 0, coffImage.Length); AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(OnAssemblyLoad); Assembly coffAssembly = Assembly.Load(coffImage); }}Quote:
Original post by Khaos Dragon
In order to be load an assembly from a resource, I had to strong name the assembly. Will it have to be strong named on my friends computers?
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more