<p>I have a non-.Net executable file that is included in my .net assembly as an embedded resource.  Is there a way to run this executable that does not involve writing it out to disk and launching it?</p>

<p>This is .Net 2.0.</p>

[{'answer_id': 72742, 'author': 'Rob Walker', 'author_id': 3631, 'author_profile': 'https://Stackoverflow.com/users/3631', 'pm_score': 3, 'selected': True, 'text': '<p>You can load a .NET assembly from a byte array using an overload of <a href="http://msdn.microsoft.com/en-us/library/twt16z2x.aspx" rel="nofollow noreferrer">Assembly.Load</a>.</p>\n<p>However, there are implications for the security model that need to be considered which make things more complex.  See the discussion <a href="http://blogs.msdn.com/shawnfa/archive/2007/04/18/loading-an-assembly-as-a-byte-array.aspx" rel="nofollow noreferrer">here</a>, and also this <a href="https://web.archive.org/web/20160513112857/http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.clr/2006-08/msg00069.html" rel="nofollow noreferrer">thread</a>.</p>\n<p>If your embedded executable is not .NET then I think you will have to write it out to disk  first.</p>\n'}, {'answer_id': 79595, 'author': 'Jacob Krall', 'author_id': 3140, 'author_profile': 'https://Stackoverflow.com/users/3140', 'pm_score': 2, 'selected': False, 'text': '<p>You might try injecting your exe into a suspended process and then awakening the hijacked process, but this seems like a recipe for disaster.</p>\n'}]
['https://Stackoverflow.com/questions/72615', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9323/']