Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:45:50+00:00 2026-06-07T05:45:50+00:00

I want to make use of .net dlls in node.js. Does that mean I

  • 0

I want to make use of .net dlls in node.js. Does that mean I need to make those dlls available with c/c++ using ‘clr hosting’, a la

  • .NET Framework 4 Hosting Interfaces or
  • Hosting the Common Language Runtime

Unfortunately the example Creating a nodejs native .Net extension over at github was a bit of a disappointment, just scroll down to the last step

Change the “Common Language Runtime Support” option to No Common Language RunTime Support

and you know what I mean. Correction to do that article justice: It suggests to change that option to “No Common Language RunTime Support” only for the file SharpAddon.cpp, so other .cpp-files you add will have CLR support enabled (the default for a CLR project), which means you can in fact use .net dlls from those other .cpp files.

This question is actually a duplicate of Using a .NET DLL in Node.js / serverside javascript, which was written at a time when there was not even a native Windows port of node, so times might have changed, although google makes me doubt it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:45:51+00:00Added an answer on June 7, 2026 at 5:45 am

    Update: node-gyp can do the manual steps below automatically when the binding.gyp file is setup properly. See this answer for this simplified procedure.


    It turned out to be rather easy. After struggling with CLR hosting and getting data in and out of the host for a while, it turns out you can actually enable /clr for your node extension no problem (so far). Here’s how:

    • follow the instructions on http://nodejs.org/api/addons.html to generate the project files
    • open the generated .sln in Visual Studio (I’m on VS 2010) and enable /clr in the project settings
    • now it probably won’t build and you have to let the – in this case actually quite helpful – error messages guide you to the flags that conflict with /clr

    The flags that I had to change to make it work:

    • disable /EHsc (C++ exceptions)
    • disable /RTC1 and /RTCsu
    • Release: change /MT to /MD
    • Debug: change /MTd to /MDd
    • Release: change /GR- to /GR

    Then you can mix managed and unmanaged code like this, referencing your .net dlls.

    #pragma managed
    
    #using <managed.dll>
    
    void callManaged()
    {
        managed::Class1^ c1 = gcnew managed::Class1();
        System::String^ result = c1->Echo("hola");
        System::Console::WriteLine("It works: " + result);
    }
    
    #pragma unmanaged
    
    Handle<Value> Method(const Arguments& args) {
      HandleScope scope;
      callManaged();
      return scope.Close(String::New("world"));
    }
    

    Update Just discovered this link with an easy https://web.archive.org/web/20170702003703/http://joseoncode.com/2012/04/10/writing-your-first-native-module-for-node-dot-js-on-windows/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a tray applet using Qt that will use an output
I am using a ARM Cortex-M3, and a Cortex-M4. I want to make use
I want to make custom select from the database table using Linq. We use
i want to make use of Com intefaces into my .net application, but this
I started to use ADO.NET for 3 days and want to make a program
I don't want to use WebKit .NET because it doesn't have some functionality that
I want make validation jquery without using from plugin , problem is here that
I want to make use of an API but it print alot of info
I want to develop multimedia encoder for Linux. I want to make use of
I'm building a few SharePoint sites, and I want to make use of zones

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.