简体   繁体   English

是否可以在Linux上使用node.js子进程执行dotnet exe?

[英]is it possible to execute dotnet exe on linux with node.js child process?

I have an exe, what was created with dotnet. 我有一个exe,是用dotnet创建的。 I have an rhc server, where I want to run this exe, and catch the oputput of it (with child-process). 我有一个rhc服务器,我想在其中运行此exe,并捕获它的oputput(带有子进程)。 But I have a folowing error: 但是我有以下错误:

cannot execute binary file 无法执行二进制文件

I understand that is not executeable on linux, but is there any solution to solve this, without rewrite the exe, or change os? 我知道这在Linux上无法执行,但是有没有解决方案可以解决此问题,而无需重写exe​​或更改os? Are there any node package, what can solve this? 是否有任何节点包,如何解决?

Very thanx for your answers! 非常感谢您的回答!

I don't think this is possible without recompiling the exe. 我认为如果不重新编译exe,这是不可能的。 If you had the sources, you could compile them with mono and invoke mono from node. 如果您有源,则可以使用mono编译它们并从node调用mono。

You can try using Wine for launching windows binaries in linux. 您可以尝试使用Wine在Linux中启动Windows二进制文件。 It is not 100% compatible with all windows libraries but it supports a lot of applications. 它不是与所有Windows库都100%兼容,但它支持许多应用程序。 So instead of trying to execute exe directly from node, you can call the wine command to launch the exe for you. 因此,可以尝试调用wine命令为您启动exe,而不是尝试直接从节点执行exe。

You cna get more info on wine at http://www.winehq.org 您可以在http://www.winehq.org上获得有关葡萄酒的更多信息

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

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