edge.js

Using Edge.js from a C# console application

删除回忆录丶 提交于 2019-12-11 11:34:41
问题 I'm trying to do something that seems very simple, yet I cannot get it to work. I've installed Edge.js via nuget and I want to execute a piece of Javascript from inside a C# console application. The code from my public static void main is below: Task.Run(async () => { Console.WriteLine( await Edge.Func("return function() { return 'hello world'; }")(null).Result ); }).Wait(); I run the application and all it does is hangs. I've tried this: Console.WriteLine(Edge.Func("return function() {

Node.js / Edge.js - Insert JS variables into SQL

荒凉一梦 提交于 2019-12-10 12:04:18
问题 I'm currently using Node.js with Edge.js to insert hardcoded values into a SQL database: var insertUser = edge.func('sql', function () {/* INSERT INTO dbo.Newsletter (Email, Active, DateCreated, DateUpdated, Deleted) VALUES ('test2@test.com','1','2014-01-01 00:00:00','2014-01-01 00:00:00','0') */}); This works correctly. However, I'd like the values to be previously-defined JS variables, not hardcoded. So if I have defined this variable: var emailAddress = document.getElementById('emailInput'

How to forcibly keep a Node.js process from terminating?

馋奶兔 提交于 2019-12-03 04:55:55
问题 TL;DR What is the best way to forcibly keep a Node.js process running, i.e., keep its event loop from running empty and hence keeping the process from terminating? The best solution I could come up with was this: const SOME_HUGE_INTERVAL = 1 << 30; setInterval(() => {}, SOME_HUGE_INTERVAL); Which will keep an interval running without causing too much disturbance if you keep the interval period long enough. Is there a better way to do it? Long version of the question I have a Node.js script

How to forcibly keep a Node.js process from terminating?

旧街凉风 提交于 2019-12-02 17:26:27
TL;DR What is the best way to forcibly keep a Node.js process running, i.e., keep its event loop from running empty and hence keeping the process from terminating? The best solution I could come up with was this: const SOME_HUGE_INTERVAL = 1 << 30; setInterval(() => {}, SOME_HUGE_INTERVAL); Which will keep an interval running without causing too much disturbance if you keep the interval period long enough. Is there a better way to do it? Long version of the question I have a Node.js script using Edge.js to register a callback function so that it can be called from inside a DLL in .NET. This

Converting docx to html with dotnet-mammoth fails at deploy server

二次信任 提交于 2019-12-02 04:29:42
I'm using dotnet-mammoth ( mammoth.js with edge.js ) to convert a docx document to html in .net I added it to my project via its nuget package . I'm using the code provided by the sample, which is working correctly in my development enviroment (running IIS Express): var documentConverter = new Mammoth.DocumentConverter(); var result = documentConverter.ConvertToHtml(Server.MapPath("~/files/document.docx")); // problem here at production enviroment string theResult = result.Value However, once I deploy it to production server, when the executed code reaches documentConverter.ConvertToHtml()

Load WCF app.config bindings in edge.js app

白昼怎懂夜的黑 提交于 2019-11-28 14:19:53
I have a WCF client for soap service, generated via SvcUtil that I want to consume via edge.js Is it possible to load an service model binding from an app.config using edge.js or will I have to construct the bindings in c#? If I can, Where should the app.config live? Thanks, Gareth. When running C# code within Node.js app using Edge.js, the app config file is node.exe.config and should be located right next to the node.exe file. 来源: https://stackoverflow.com/questions/17170174/load-wcf-app-config-bindings-in-edge-js-app

Using a .NET DLL in Node.js / serverside javascript

我们两清 提交于 2019-11-27 10:39:14
I have a pet project that is an online game, the entire game engine is written in C# and I would like to know if there is anyway I can call the functions of this existing assembly (.dll) from a solution built using Node.JS, Socket.IO, Express etc? The game engine itself is pretty complete; tested and robust. I am hoping there is some neat way of exposing its functionality without too much overhead. UPDATE : To answer my own question a little.. I have ended building my own web socket server (based on the most current web socket protocol document). It is written in C# and compiled using Mono so

Load WCF app.config bindings in edge.js app

纵饮孤独 提交于 2019-11-27 08:34:14
问题 I have a WCF client for soap service, generated via SvcUtil that I want to consume via edge.js Is it possible to load an service model binding from an app.config using edge.js or will I have to construct the bindings in c#? If I can, Where should the app.config live? Thanks, Gareth. 回答1: When running C# code within Node.js app using Edge.js, the app config file is node.exe.config and should be located right next to the node.exe file. 来源: https://stackoverflow.com/questions/17170174/load-wcf

Using a .NET DLL in Node.js / serverside javascript

空扰寡人 提交于 2019-11-26 15:16:33
问题 I have a pet project that is an online game, the entire game engine is written in C# and I would like to know if there is anyway I can call the functions of this existing assembly (.dll) from a solution built using Node.JS, Socket.IO, Express etc? The game engine itself is pretty complete; tested and robust. I am hoping there is some neat way of exposing its functionality without too much overhead. UPDATE : To answer my own question a little.. I have ended building my own web socket server