Node.js的.net擴展 node.net

jopen 12年前發布 | 56K 次閱讀 Node.js Node.js擴展

node.js 的.net擴展, 使node.js的js代碼可以調用 .NET 方法。

  1. Read this short description on how to build a simple nodejs addon on windows.
  2. Download node.js sources.
  3. Make sure you have Python 2.x installed (not 3.x).
  4. Build node sources by running `vcbuild.bat'.
  5. Verify that node.lib is located under the Debug/ directory.

Creating a .Net node addon

  1. Fire up VS2010 and create a new C++ Empty CLR project.Node.js的.net擴展 node.net
  2. Open the project properties (Click Alt+Enter while the project file is selected)
  3. Set the project type and extension project type should be dll and the extension should be .node Node.js的.net擴展 node.net
  4. Set the include directories as follows (replace paths with the local nodejs source path).Node.js的.net擴展 node.net
  5. Set the libraries directories as follows (replace paths with the local nodejs source path).Node.js的.net擴展 node.net
  6. Add a new CPP file and call it SOME_PREFIX_Addon.cpp. This file will hold the actual addon definitions and dll entry point.
  7. Open the property pages of the new CPP file you created.
  8. Change the "Common Language Runtime Support" option to No Common Language RunTime Support
    Node.js的.net擴展 node.net

項目主頁:http://www.baiduhome.net/lib/view/home/1338389339589

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!