Web Service 在不使用 edge-js 时运行良好,但是在包含 edge-js 时出现错误。
Azure Web 服务操作系统是 64 位的。
dll有问题吗?
Azure Web 服务 scm 错误日志
\\?\D:\home\site\wwwroot\node_modules\edge-js\build\Release\edge_nativeclr.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (D:\home\site\wwwroot\node_modules\edge-js\lib\edge.js:52:8)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
Thu Sep 02 2021 04:44:56 GMT+0000 (Greenwich Mean Time): Application has thrown an uncaught
exception and is terminated:
Error: \\?\D:\home\site\wwwroot\node_modules\edge-js\build\Release\edge_nativeclr.node is not
a valid Win32 application.
这是我的代码
const edge = require('edge-js');
const express = require('express');
const next = require('next');
nextApp.prepare().then(() => {
var add7 = edge.func({
assemblyFile: 'ClassLibrary1.dll', //dll name
typeName: 'ClassLibrary1.Startup', //namespace, classname
methodName: 'Invoke' // method : This must be Func<object,Task<object>>
});
add7(15, function (error, result) {
if (error) throw error;
console.log(result);
});
var Method = edge.func('dllCreate.dll');
Method(12, function (error, result) {
if (error) throw error;
console.log(result);
})
var helloWorld = edge.func(`
async (input) => {
return ".NET Welcomes " + input.ToString();
}
`);
helloWorld('JavaScript', function (error, result) {
if (error) throw error;
console.log(result);
});
});
如何修复它。请。