简体   繁体   English

您可以从 64 位进程创建 32 位 AppDomain 吗?

[英]Can you create a 32-bit AppDomain from a 64-bit process?

Is it possible to create an AppDomain to host/run some 32-bit code from a 64-bit process, and then be able to pass/marshal data from the newly created AppDomain to host AppDomain?是否可以创建一个 AppDomain 从 64 位进程托管/运行一些 32 位代码,然后能够从新创建的 AppDomain 传递/编组数据以托管 AppDomain?

I could do this as an out-of-process executable, but I am trying to avoid having a large binary foot-print for the 32-bit process (which happens to be a stand-alone .NET 6.0 console executable).我可以将其作为进程外可执行文件执行,但我试图避免 32 位进程(恰好是独立的 .NET 6.0 控制台可执行文件)占用大量二进制文件。

You can't half on the same process to run as 64 bit and the other as 32 bit.您不能一半在同一进程上以 64 位运行,而另一个以 32 位运行。 So even if .Net 6 would support creating AppDomains ( which it does not ) creating 32bit AppDomain in 64bit process would not work.因此,即使 .Net 6 支持创建 AppDomain( 它不支持)在 64 位进程中创建 32 位 AppDomain 也不起作用。

You need to create separate processes for that which may share most of the code /binaries - you only need bootstraping app to be explicitly 32 or 64 bits, the rest of your assemblies can be "Any".您需要为可能共享大部分代码/二进制文件的进程创建单独的进程 - 您只需要将引导应用程序显式设置为 32 位或 64 位,其余程序集可以是“任何”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM