0

在 Azure Web App 中部署我的节点 js 项目时,我收到构建错误:“指定项目或解决方案文件。当前工作目录不包含 .dll 节点 js 中的项目或解决方案文件”。我使用 Edge js 在我的节点 js 中调用 .dll 导致此错误,尽管它在 Visual Studio 中运行良好。此 .dll 文件用于为给定的订单详细信息生成许可证,如下所示:

const express = require("express");
const bodyParser = require("body-parser");
var edge = require('edge-js');

const app = express();
const port = process.env.PORT || 3000
app.use(express.json())

app.get("/", function(req, res) {
console.log(__dirname);
res.sendFile(__dirname + "/index.html");
});

app.use(express.static("public"));
app.use(bodyParser.urlencoded({
extended: true
}));

app.listen(port, function(req, res) {
console.log(Server is running on port ${port});
});

var GenUnlockCode = edge.func('./public/Vab_dll/VabLib.dll');
var OrderDetails = {
stockCode: '337839',
expiryDate: '2022-01-01',
gwID: '027851153510-000147'
};
GenUnlockCode(OrderDetails, function(error, unlockCode) {
if (error) throw error;
console.log(unlockCode);
});

Azure 日志中的错误消息显示“这不是已发布的独立应用程序,我们无法找到 .NET Core SDK。请确保已安装它”。我不确定那是什么意思。请高手帮忙!

2021-12-11T06:48:18.768943986Z _____
2021-12-11T06:48:18.768983986Z / _ \ __________ _________ ____
2021-12-11T06:48:18.768989686Z / /\ ___ / | _ __ _/ __ \
2021-12-11T06:48:18.768993486Z / | / /| | /| | /\ /
2021-12-11T06:48:18.768997086Z _|__ /_____ _/ || ___ >
2021-12-11T06:48:18.769001286Z / / /
2021-12-11T06:48:18.769004886Z A P P S E R V I C E O N L I N U X
2021-12-11T06:48:18.769008386Z
2021-12-11T06:48:18.769011486Z Documentation: http://aka.ms/webapp-linux
2021-12-11T06:48:18.769014886Z NodeJS quickstart: https://aka.ms/node-qs
2021-12-11T06:48:18.769018186Z NodeJS Version : v14.17.4
2021-12-11T06:48:18.769021386Z Note: Any data outside '/home' is not persisted
2021-12-11T06:48:18.769024786Z
2021-12-11T06:48:19.221926151Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2021-12-11T06:48:19.239983406Z Build Operation ID: |OefU//3eq74=.3a19627a_
2021-12-11T06:48:20.390094678Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2021-12-11T06:48:20.749663166Z Writing output script to '/opt/startup/startup.sh'
2021-12-11T06:48:21.389539103Z Running #!/bin/sh
2021-12-11T06:48:21.389579003Z
2021-12-11T06:48:21.389585303Z # Enter the source directory to make sure the script runs where the user expects
2021-12-11T06:48:21.389589803Z cd "/home/site/wwwroot"
2021-12-11T06:48:21.389594003Z
2021-12-11T06:48:21.389598303Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2021-12-11T06:48:21.389602403Z if [ -z "$PORT" ]; then
2021-12-11T06:48:21.389606603Z export PORT=8080
2021-12-11T06:48:21.389611003Z fi
2021-12-11T06:48:21.389614803Z
2021-12-11T06:48:21.389618703Z echo Found tar.gz based node_modules.
2021-12-11T06:48:21.389622703Z extractionCommand="tar -xzf node_modules.tar.gz -C /node_modules"
2021-12-11T06:48:21.389626903Z echo "Removing existing modules directory from root..."
2021-12-11T06:48:21.389631003Z rm -fr /node_modules
2021-12-11T06:48:21.389635003Z mkdir -p /node_modules
2021-12-11T06:48:21.389639603Z echo Extracting modules...
2021-12-11T06:48:21.389643603Z $extractionCommand
2021-12-11T06:48:21.389647504Z export NODE_PATH="/node_modules":$NODE_PATH
2021-12-11T06:48:21.389651604Z export PATH=/node_modules/.bin:$PATH
2021-12-11T06:48:21.389655504Z if [ -d node_modules ]; then
2021-12-11T06:48:21.389659604Z mv -f node_modules _del_node_modules || true
2021-12-11T06:48:21.389663504Z fi
2021-12-11T06:48:21.389680304Z
2021-12-11T06:48:21.389684004Z if [ -d /node_modules ]; then
2021-12-11T06:48:21.389687704Z ln -sfn /node_modules ./node_modules
2021-12-11T06:48:21.389691404Z fi
2021-12-11T06:48:21.389694804Z
2021-12-11T06:48:21.389698304Z echo "Done."
2021-12-11T06:48:21.392477312Z npm start
2021-12-11T06:48:21.415701282Z Found tar.gz based node_modules.
2021-12-11T06:48:21.415721583Z Removing existing modules directory from root...
2021-12-11T06:48:21.432192032Z Extracting modules...
2021-12-11T06:48:22.719601839Z Done.
2021-12-11T06:48:24.856771165Z npm info it worked if it ends with ok
2021-12-11T06:48:24.858485870Z npm info using npm@6.14.14
2021-12-11T06:48:24.858502570Z npm info using node@v14.17.4
2021-12-11T06:48:27.395197882Z npm info lifecycle lincoln_9.3@1.0.0prestart: lincoln_9.3@1.0.0
2021-12-11T06:48:27.428169277Z npm info lifecycle lincoln_9.3@1.0.0start: lincoln_9.3@1.0.0
2021-12-11T06:48:27.447886734Z
2021-12-11T06:48:27.447934234Z > lincoln_9.3@1.0.0 start /home/site/wwwroot
2021-12-11T06:48:27.447941234Z > nodemon expserver.js
2021-12-11T06:48:27.447945734Z
2021-12-11T06:48:29.881821389Z �[33m[nodemon] 2.0.15�[39m
2021-12-11T06:48:29.890333614Z �[33m[nodemon] to restart at any time, enter rs�[39m
2021-12-11T06:48:29.892783521Z �[33m[nodemon] watching path(s): *.*�[39m
2021-12-11T06:48:29.892808321Z �[33m[nodemon] watching extensions: js,mjs,json�[39m
2021-12-11T06:48:29.892814121Z �[32m[nodemon] starting node expserver.js�[39m
2021-12-11T06:48:31.450890659Z Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.CSharp', version: '4.5.0', path: 'lib/netstandard1.3/Microsoft.CSharp.dll'
2021-12-11T06:48:31.471303619Z
2021-12-11T06:48:31.471336819Z internal/modules/cjs/loader.js:1131
2021-12-11T06:48:31.471342419Z return process.dlopen(module, path.toNamespacedPath(filename));
2021-12-11T06:48:31.471346819Z ^
2021-12-11T06:48:31.481192347Z Error: This is not a published, standalone application and we are unable to locate the .NET Core SDK. Please make sure that it is installed; see http://microsoft.com/net/core for more details.
2021-12-11T06:48:31.481238948Z at Object.Module._extensions..node (internal/modules/cjs/loader.js:1131:18)
2021-12-11T06:48:31.481245548Z at Module.load (internal/modules/cjs/loader.js:937:32)
2021-12-11T06:48:31.481250348Z at Function.Module._load (internal/modules/cjs/loader.js:778:12)
2021-12-11T06:48:31.481254548Z at Module.require (internal/modules/cjs/loader.js:961:19)
2021-12-11T06:48:31.481258748Z at Module.patchedRequire [as require] (/agents/node/node_modules/diagnostic-channel/dist/src/patchRequire.js:15:46)
2021-12-11T06:48:31.481277148Z at require (internal/modules/cjs/helpers.js:92:18)
2021-12-11T06:48:31.481281048Z at Object. (/node_modules/edge-js/lib/edge.js:52:8)
2021-12-11T06:48:31.481285148Z at Module._compile (internal/modules/cjs/loader.js:1072:14)
2021-12-11T06:48:31.481295348Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
2021-12-11T06:48:31.481299248Z at Module.load (internal/modules/cjs/loader.js:937:32)
2021-12-11T06:48:31.503689413Z �[31m[nodemon] app crashed - waiting for file changes before starting...�[39m
2021-12-11T06:49:59.592524675Z ApplicationInsights:CorrelationIdManager [
2021-12-11T06:49:59.592569976Z Error: read ECONNRESET
2021-12-11T06:49:59.592577176Z at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
2021-12-11T06:49:59.592582476Z at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:17) {
2021-12-11T06:49:59.592587276Z errno: -104,
2021-12-11T06:49:59.592591976Z code: 'ECONNRESET',
2021-12-11T06:49:59.592596676Z syscall: 'read'
2021-12-11T06:49:59.592601376Z }
2021-12-11T06:49:59.592605976Z ]
2021-12-11T06:50:05.051388088Z ApplicationInsights:CorrelationIdManager [
2021-12-11T06:50:05.051425588Z Error: read ECONNRESET
2021-12-11T06:50:05.051431188Z at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)
2021-12-11T06:50:05.051435988Z at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:17) {
2021-12-11T06:50:05.051440188Z errno: -104,
2021-12-11T06:50:05.051444188Z code: 'ECONNRESET',
2021-12-11T06:50:05.051448188Z syscall: 'read'
2021-12-11T06:50:05.051458388Z }
2021-12-11T06:50:05.051462388Z ]
4

0 回答 0