Skip to content

Commit d24b545

Browse files
committed
Merge branch 'master' of github.com:saary/node.net
2 parents 4657123 + 5802706 commit d24b545

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Creating a nodejs native .Net extension
2+
This short writeup will guide you through creating a simple node.js addon
3+
4+
## Before we begin
5+
1. Read [this](http://coderesearchlabs.com/articles/BNWCA.pdf) short description on how to build a simple nodejs addon on windows.
6+
2. Download node.js [sources](http://nodejs.org/#download).
7+
3. Make sure you have [Python 2.x](http://www.python.org/download/) installed (not 3.x).
8+
4. Build node sources by running `vcbuild.bat'.
9+
5. Verify that node.lib is located under the Debug/ directory.
10+
11+
## Creating a .Net node addon
12+
1. Fire up VS2010 and create a new C++ Empty CLR project.
13+
![new project](https://github.com/saary/node.net/raw/master/images/CreateClrVCProject.png)
14+
2. Open the project properties (Click Alt+Enter while the project file is selected)
15+
3. Set the project type and extension project type should be *dll* and the extension should be *.node*
16+
![new project](https://github.com/saary/node.net/raw/master/images/SetProjectType.png)
17+
4. Set the include directories as follows (replace paths with the local nodejs source path).
18+
![new project](https://github.com/saary/node.net/raw/master/images/SetIncludes.png)
19+
5. Set the libraries directories as follows (replace paths with the local nodejs source path).
20+
![new project](https://github.com/saary/node.net/raw/master/images/SetLibrariesDirs.png)
21+
6. Add a new CPP file and call it SOME_PREFIX_Addon.cpp.
22+
This file will hold the actual addon definitions and dll entry point.
23+
7. Open the property pages of the **new CPP file** you created.
24+
8. Change the "Common Language Runtime Support" option to **No Common Language RunTime Support**
25+
![new project](https://github.com/saary/node.net/raw/master/images/AddonProperties.png)
26+
27+
## What's next?
28+
* use the project provided here as an initial implementation.
29+
* take a look at the following [html presentation](http://kkaefer.github.com/node-cpp-modules/#api-how-hard-to-misuse).
30+
the ppt explains the different steps necessary to register a class with V8.
31+
* start rocking!

0 commit comments

Comments
 (0)