Maxwell175
Member
I am making a program that is sort of a frontend to all my other apps. :smash: I put the EXEs of those apps into the resources of my frontend. The problem occurs when I try to run the EXEs from memory.
I keep getting System.Reflection.TargetInvocationException on the line: :kaioken:
I got the above code from: [RESOLVED] how can i run exe file from embedded files(Resource)? - VBForums
P.S. To run this code you need to import the following:
I keep getting System.Reflection.TargetInvocationException on the line: :kaioken:
entryPoint.Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {New String() {"1"}})
Public Sub RunExe(ByVal ResourcesBuffer As Byte()) Dim Resource As String = String.Empty Dim assembly As Assembly = assembly.Load(ResourcesBuffer) Dim entryPoint As MethodInfo = [assembly].EntryPoint Dim objectValue As Object = RuntimeHelpers.GetObjectValue([assembly].CreateInstance(entryPoint.Name)) entryPoint.Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {New String() {"1"}}) End Sub
I got the above code from: [RESOLVED] how can i run exe file from embedded files(Resource)? - VBForums
P.S. To run this code you need to import the following:
Imports System.Runtime.InteropServices Imports System.Reflection Imports System.Runtime.CompilerServices
Last edited: