I'm using Assembly.Load()
and then EntryPoint.Invoke(null, null)
in order to run a .NET assembly in memory. This works, unless if the host process is x86 and the executed assembly is AnyCPU. In this case, the executed assembly gets executed in x86 context and therefore malfunctions.
Is there a way to execute the Assemly object in an AnyCPU context, even if the host process is x86?