Is it possible to call a C# function from Node.JS/JavasciptHidden Features of C#?Calling the base constructor in C#Best way to repeat a character in C#Get int value from enum in C#How to decide when to use Node.js?In Node.js, how do I “include” functions from my other files?How can I add new array elements at the beginning of an array in Javascript?Pure JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for itHow do I return the response from an asynchronous call?Why not inherit from List<T>?

How to retract the pitched idea from employer?

What is this solid state starting relay component?

How do I write "Show, Don't Tell" as a person with Asperger Syndrome?

What are the peak hours for public transportation in Paris?

siunitx error: Invalid numerical input

Where does this pattern of naming products come from?

Efficient integer floor function in C++

Why is the application of an oracle function not a measurement?

What LISP compilers and interpreters were available for 8-bit machines?

Do you need type ratings for private flying?

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

Cause of continuous spectral lines

Version 2 - print new even-length arrays from two arrays

Are "living" organ banks practical?

Select items in a list that contain criteria #2

Why does the Schrödinger equation work so well for the Hydrogen atom despite the relativistic boundary at the nucleus?

Strange symbol for two functions

Did the first version of Linux developed by Linus Torvalds have a GUI?

Is it recommended against to open-source the code of a webapp?

How to generate random points without duplication?

Etymology of 'calcit(r)are'?

How hard would it be to convert a glider into an powered electric aircraft?

Is it possible to express disjunction through conjunction and implication?

Last survivors from different time periods living together



Is it possible to call a C# function from Node.JS/Javascipt


Hidden Features of C#?Calling the base constructor in C#Best way to repeat a character in C#Get int value from enum in C#How to decide when to use Node.js?In Node.js, how do I “include” functions from my other files?How can I add new array elements at the beginning of an array in Javascript?Pure JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for itHow do I return the response from an asynchronous call?Why not inherit from List<T>?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I wonder if it is possible to call a C# function from javascript like I try to do below as an example? (I use Node.js)



Is it possible to combine this in anyway to let the csharpfunction use its way to calculate doubles, Int32 etc csharp types for calculation?






var a = 4;
var b = 3;
var array = ["1", "2"];

//Is it possible to call the "csharpfunction" from javascript?


double csharpfunction(double a, double b, string[] array)

a = a * b;
return a;












share|improve this question






























    2















    I wonder if it is possible to call a C# function from javascript like I try to do below as an example? (I use Node.js)



    Is it possible to combine this in anyway to let the csharpfunction use its way to calculate doubles, Int32 etc csharp types for calculation?






    var a = 4;
    var b = 3;
    var array = ["1", "2"];

    //Is it possible to call the "csharpfunction" from javascript?


    double csharpfunction(double a, double b, string[] array)

    a = a * b;
    return a;












    share|improve this question


























      2












      2








      2








      I wonder if it is possible to call a C# function from javascript like I try to do below as an example? (I use Node.js)



      Is it possible to combine this in anyway to let the csharpfunction use its way to calculate doubles, Int32 etc csharp types for calculation?






      var a = 4;
      var b = 3;
      var array = ["1", "2"];

      //Is it possible to call the "csharpfunction" from javascript?


      double csharpfunction(double a, double b, string[] array)

      a = a * b;
      return a;












      share|improve this question
















      I wonder if it is possible to call a C# function from javascript like I try to do below as an example? (I use Node.js)



      Is it possible to combine this in anyway to let the csharpfunction use its way to calculate doubles, Int32 etc csharp types for calculation?






      var a = 4;
      var b = 3;
      var array = ["1", "2"];

      //Is it possible to call the "csharpfunction" from javascript?


      double csharpfunction(double a, double b, string[] array)

      a = a * b;
      return a;








      var a = 4;
      var b = 3;
      var array = ["1", "2"];

      //Is it possible to call the "csharpfunction" from javascript?


      double csharpfunction(double a, double b, string[] array)

      a = a * b;
      return a;





      var a = 4;
      var b = 3;
      var array = ["1", "2"];

      //Is it possible to call the "csharpfunction" from javascript?


      double csharpfunction(double a, double b, string[] array)

      a = a * b;
      return a;






      javascript c# node.js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 21:28









      Burak Yeniçeri

      5611




      5611










      asked Mar 24 at 15:33









      AndreasAndreas

      1881111




      1881111






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Because C# has its own garbage collection system and thus needs its own infrastructure running and its data formats are completely different and custom, it would probably be simplest to just wrap your function in a super simple server, run that separate process from your node.js app and then send requests to that server (probably via localhost on a predetermined port) to execute whatever you're trying to do. You can decide what type of server and data interchange format you want to use, but HTTP and JSON would be simple and quick to implement as long as they didn't cause efficiency issues. For the data to go between languages, it's going to have to be put in some standard format any way.



          node.js has an addon system, but it is geared to C/C++ so you'd probably have to wrap your C# code in a C/C++ wrapper to use it directly and you'd still probably have to put your C# code in its own process in order to allow its garbage collector to have a place to run and do its thing. My sense is that a simple server in its own process is probably even easier than using the addon system in this case.






          share|improve this answer

























          • I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

            – Andreas
            Mar 24 at 16:02











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325428%2fis-it-possible-to-call-a-c-sharp-function-from-node-js-javascipt%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Because C# has its own garbage collection system and thus needs its own infrastructure running and its data formats are completely different and custom, it would probably be simplest to just wrap your function in a super simple server, run that separate process from your node.js app and then send requests to that server (probably via localhost on a predetermined port) to execute whatever you're trying to do. You can decide what type of server and data interchange format you want to use, but HTTP and JSON would be simple and quick to implement as long as they didn't cause efficiency issues. For the data to go between languages, it's going to have to be put in some standard format any way.



          node.js has an addon system, but it is geared to C/C++ so you'd probably have to wrap your C# code in a C/C++ wrapper to use it directly and you'd still probably have to put your C# code in its own process in order to allow its garbage collector to have a place to run and do its thing. My sense is that a simple server in its own process is probably even easier than using the addon system in this case.






          share|improve this answer

























          • I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

            – Andreas
            Mar 24 at 16:02















          2














          Because C# has its own garbage collection system and thus needs its own infrastructure running and its data formats are completely different and custom, it would probably be simplest to just wrap your function in a super simple server, run that separate process from your node.js app and then send requests to that server (probably via localhost on a predetermined port) to execute whatever you're trying to do. You can decide what type of server and data interchange format you want to use, but HTTP and JSON would be simple and quick to implement as long as they didn't cause efficiency issues. For the data to go between languages, it's going to have to be put in some standard format any way.



          node.js has an addon system, but it is geared to C/C++ so you'd probably have to wrap your C# code in a C/C++ wrapper to use it directly and you'd still probably have to put your C# code in its own process in order to allow its garbage collector to have a place to run and do its thing. My sense is that a simple server in its own process is probably even easier than using the addon system in this case.






          share|improve this answer

























          • I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

            – Andreas
            Mar 24 at 16:02













          2












          2








          2







          Because C# has its own garbage collection system and thus needs its own infrastructure running and its data formats are completely different and custom, it would probably be simplest to just wrap your function in a super simple server, run that separate process from your node.js app and then send requests to that server (probably via localhost on a predetermined port) to execute whatever you're trying to do. You can decide what type of server and data interchange format you want to use, but HTTP and JSON would be simple and quick to implement as long as they didn't cause efficiency issues. For the data to go between languages, it's going to have to be put in some standard format any way.



          node.js has an addon system, but it is geared to C/C++ so you'd probably have to wrap your C# code in a C/C++ wrapper to use it directly and you'd still probably have to put your C# code in its own process in order to allow its garbage collector to have a place to run and do its thing. My sense is that a simple server in its own process is probably even easier than using the addon system in this case.






          share|improve this answer















          Because C# has its own garbage collection system and thus needs its own infrastructure running and its data formats are completely different and custom, it would probably be simplest to just wrap your function in a super simple server, run that separate process from your node.js app and then send requests to that server (probably via localhost on a predetermined port) to execute whatever you're trying to do. You can decide what type of server and data interchange format you want to use, but HTTP and JSON would be simple and quick to implement as long as they didn't cause efficiency issues. For the data to go between languages, it's going to have to be put in some standard format any way.



          node.js has an addon system, but it is geared to C/C++ so you'd probably have to wrap your C# code in a C/C++ wrapper to use it directly and you'd still probably have to put your C# code in its own process in order to allow its garbage collector to have a place to run and do its thing. My sense is that a simple server in its own process is probably even easier than using the addon system in this case.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 16:37

























          answered Mar 24 at 15:40









          jfriend00jfriend00

          449k56596641




          449k56596641












          • I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

            – Andreas
            Mar 24 at 16:02

















          • I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

            – Andreas
            Mar 24 at 16:02
















          I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

          – Andreas
          Mar 24 at 16:02





          I see, so I should use an own process in someway and pass the calculations there. It sounds like a good and clean way to do it. Thank you!

          – Andreas
          Mar 24 at 16:02



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325428%2fis-it-possible-to-call-a-c-sharp-function-from-node-js-javascipt%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript