edge.js

Creating a dataservice to communicate between c# api and frontend (angular)

我只是一个虾纸丫 提交于 2021-02-11 09:02:03
问题 I need some help with this. I'm supposed to create a plugin for a webpage in angular that communicates with an API written in C# which is already in a .dll. What is the best approach to this? I already created a data.service.ts with the following code to get data from the api: import { Injectable, ValueProvider } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class DataService { edge : any = require('edge'); constructor() { } getData(type: String, method: String) { var data

Assemble .NET dll in Node.js using edge

假如想象 提交于 2021-02-10 05:11:25
问题 I am not very familiar with dll or .NET. I am trying to run dll libraries using node. I am using edge.js. Essentially, I have a directory bin/Debug with several dll files. I'm looping through the files and trying to assemble each of them o that i can run some methods from the dll. const edge = require('edge-js') const dllPath = './somePath/bin/Debug/' const fs = require('fs') const path = require('path') let obj = {} fs.readdir(dllPath, [], (err, files) => { files.forEach((file) => { if(file

Assemble .NET dll in Node.js using edge

蹲街弑〆低调 提交于 2021-02-10 05:11:08
问题 I am not very familiar with dll or .NET. I am trying to run dll libraries using node. I am using edge.js. Essentially, I have a directory bin/Debug with several dll files. I'm looping through the files and trying to assemble each of them o that i can run some methods from the dll. const edge = require('edge-js') const dllPath = './somePath/bin/Debug/' const fs = require('fs') const path = require('path') let obj = {} fs.readdir(dllPath, [], (err, files) => { files.forEach((file) => { if(file

Can't call method inside C# DLL from node service using Edge.js

浪子不回头ぞ 提交于 2020-12-12 10:12:46
问题 I am playing with the Edge.js and were able to run most of the examples but when it comes to using compiled C# dll file, I couldn't get it working. My node.js code is var clrMethod = edge.func({ assemblyFile: 'C:\\Users\\hello\\Desktop\\Debug\\DemoClass.dll', typeName: 'DemoClass', methodName: 'Invoke' }); clrMethod(8, function (error, result) { if (error) { console.log(error); throw error; } console.log(result); }); C# DLL code is using System.Threading.Tasks; namespace DemoClass { public

Calling Node.js from C# .NET

删除回忆录丶 提交于 2020-05-07 12:44:17
问题 Is it possible to call Node.js functions from a C# ASP.NET server? I found the Edge.js library, but as I understood, it allows Node.js to call into C#. I need the directly reverse solution. 回答1: Microsoft.AspNetCore.NodeServices This provides a fast and robust way for .NET code to run JavaScript on the server inside a Node.js environment. You can use this to consume arbitrary functionality from NPM packages at runtime in your ASP.NET Core app. Most applications developers don't need to use

Calling Node.js from C# .NET

十年热恋 提交于 2020-05-07 12:43:45
问题 Is it possible to call Node.js functions from a C# ASP.NET server? I found the Edge.js library, but as I understood, it allows Node.js to call into C#. I need the directly reverse solution. 回答1: Microsoft.AspNetCore.NodeServices This provides a fast and robust way for .NET code to run JavaScript on the server inside a Node.js environment. You can use this to consume arbitrary functionality from NPM packages at runtime in your ASP.NET Core app. Most applications developers don't need to use

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

前提是你 提交于 2019-12-31 03:49:15
问题 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

Using edge.js is it possible for the .Net C# module to call the node.js part of the process, i.e. do the reverse call?

牧云@^-^@ 提交于 2019-12-14 01:01:35
问题 You can see the interop model for going from Node.js -> C#, here. What I want to know is, can the C# code then make a call to a method in the Node.js part of the process from the C#, before returning? Imagine if you had a call, like var webApi = edge.func('/MyDotNetApi.csx'); webApi(function (error, result) { log.('api started'); }); where the MyDotNetApi.csx returns, but leaves a socket listener thread running to handle HTTP requests. Now, if the Node.js part of the process holds (ever

How can I properly call a list of async functions in order? [duplicate]

走远了吗. 提交于 2019-12-13 07:43:08
问题 This question already has an answer here : How to sequentially run promises with Q in Javascript? (1 answer) Closed 4 years ago . I am attempting to write a "robocopy /mir" like function within Node.js and cannot seem to wrap my head around how to properly execute several async functions in order. Some background: The script is run on Windows, therefore, I needed to find some way to copy files while retaining modification time AND receiving progress notifications. To solve this problem, I

How do I specify node.exe.config for web app hosted on azure?

你。 提交于 2019-12-12 03:24:47
问题 I have a node server deployed to azure and am using Edge.js to make some WCF calls. When I host the server locally, everything works great because I can put the .NET config for the web service calls in node.exe.config located next to my local node.exe as recommended here. However, this does not seem feasible for a node server hosted on azure. Azure doesn't seem to let user arbitrarily put files on their file systems on whatever machine the user's server happens to be currently running on