I would like to make an experiment about running an EXE file from Resources.
Assembly a = Assembly.Load(hm_1.Properties.Resources.HashMyFiles);
MethodInfo method = a.EntryPoint;
if (method != null)
{
method.Invoke(a.CreateInstance("a"), null);
}
** For this experiment I used a file named HashMyFiles.exe which is in my resources.
However, when I debug my code I get the error:
ex {"Could not load file or assembly '59088 bytes loaded from hm_1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."} System.Exception {System.BadImageFormatException}
I read certain posts about running x86 on x64 platform mode and viceversa, changes it in visual studios, and still the same error.
Does anyone have an idea? Note: I do not want to create the file locally, only to run it from the resource.