Using a .NET DLL in Node.js / serverside javascript

后端 未结 8 1333
南旧
南旧 2020-12-02 07:27

I have a pet project that is an online game, the entire game engine is written in C# and I would like to know if there is anyway I can call the functions of this existing as

8条回答
  •  渐次进展
    2020-12-02 08:19

    .Net addons can be written, in short you write a regular native addon and add .Net calls via CLI/C++ calls to .Net dlls.

    In practice you usually create a C# dll library which you then call from a CLI/C++ node addon project. There is a bit of delicacies such as making sure that the actual node add on definition file is compiled without CLR support so node can load it correctly.

    You can check out: https://github.com/saary/node.net for an example of how this can be achieved.

提交回复
热议问题