Looking for integration info with a c# application to run scripts


I'm looking at the possibility of launching this from a C#.net application to script in-application automation instead of doing something like LUA.
The script capabilities are very simplistic custom methods, but I would need to write it out as a proprietary c# script. From what I've seen so far, I imagine I'd have to create my own module with the objects available in the current app's API as well as being able to write out the final script to C#. Nothing spectacularly difficult. A few modules already seem to do this in different languages.

What I'm unsure of is the mechanics of integrating it so it can be launched in a browser for the localhost. e.g. what kind of http server does it use/require? What kind of licensing costs, if any are associated with distributing it or it's dependencies in an application?


The normal approach is to run them separately and set up communications between them as in this Stack Overflow answer. All of those suggestions would work with Node-RED as it supports many different forms of communication.

The best answer is likely to depend on the amount and frequency of data you are exchanging.

The advantage is that you can use simple, existing methods both on the C# side and on the Node-RED side. No need for a Node-RED custom node.

Node-RED is open source, check out the license, it tells you all you need to know about redistribution and inclusion in commercial work.


Ahh I see. Assumption Error in Brain.exe.
I had looked at docker thinking it might be required for an install, that's what the licensing was about. I see how it installs now. Thanks!

A separate install won't work for me as this will all need to be configured as part of the application install, which I don't have full control over.


You should easily be able to package it all together. You will need to learn a bit about npm though.

It is perfectly possible to package up NodeJS applications. With Node-RED, all you need to think about is that the standard installation uses a global install and you won't want that for your package. However, that's not the only way to install it - in fact I rarely do. You can easily install it as just another npm package dependency. You just then need to set up a startup script to make sure that you are using the right userDir folder (that wraps up your flows).

There are other possibilities too though it doesn't sound like they would be right here. You could run everything from a NodeJS application, maybe using EdgeJS to run your C# code.