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;
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;
javascript c# node.js
add a comment |
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;
javascript c# node.js
add a comment |
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;
javascript c# node.js
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
javascript c# node.js
edited Mar 24 at 21:28
Burak Yeniçeri
5611
5611
asked Mar 24 at 15:33
AndreasAndreas
1881111
1881111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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