使用面向 Net Standard 的 DotNet Core 创建 Azure WebJob 失败并出现错误

编程入门 行业动态 更新时间:2024-10-19 21:35:57
本文介绍了使用面向 Net Standard 的 DotNet Core 创建 Azure WebJob 失败并出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 dot net core 控制台应用程序,我想在 Azure 中将其作为网络作业运行.当它尝试执行时,我在日志中看到

I have a dot net core console app that I want to run as a webjob in Azure. When it tries to execute I see in the logs

错误:未找到依赖项清单中指定的程序集 -- 包:'Microsoft.DotNet.InternalAbstractions',版本:'1.0.0',路径:'lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll'

Error: assembly specified in the dependencies manifest was not found -- package: 'Microsoft.DotNet.InternalAbstractions', version: '1.0.0', path: 'lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll'

我的 project.json 看起来像这样

My project.json looks like this

{ "buildOptions": { "emitEntryPoint": true, "copyToOutput": [ "appsettings.json", "run.cmd" ] }, "dependencies": { "Helga.Core": "1.0.0-*", "Helga.UpdateParkings": "1.0.0-*", "Microsoft.Extensions.Configuration": "1.0.0", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.1" } }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } }, "publishOptions": { "include": [ "appsettings.json", "run.cmd" ] }, "version": "1.0.0-*" }

但在 project.lock.json 中我看到

but in project.lock.json I see

"Microsoft.DotNet.InternalAbstractions/1.0.0": { "type": "package", "dependencies": { "System.AppContext": "4.1.0", "System.Collections": "4.0.11", "System.IO": "4.1.0", "System.IO.FileSystem": "4.0.1", "System.Reflection.TypeExtensions": "4.1.0", "System.Runtime.Extensions": "4.1.0", "System.Runtime.InteropServices": "4.1.0", "System.Runtime.InteropServices.RuntimeInformation": "4.0.0" }, "compile": { "lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {} }, "runtime": { "lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {} } },

请指教.

推荐答案

我已经通过压缩 bin/debug 文件夹和显然已安装的 sdk 等中的构建引用程序集来进行部署.

I had made the deployment by zipping up the bin/debug folder and apparently the build references assemblies in installed sdk's etc.

当我将项目发布到文件系统并压缩 PublishOutput 文件夹时,一切都开始工作了,因为所有依赖程序集都被复制到了该文件夹中.

When I did a Publish of the project to the filesystem and zipped up the PublishOutput folder instead everything started working because all dependant assemblies were copied to that folder.

更多推荐

使用面向 Net Standard 的 DotNet Core 创建 Azure WebJob 失败并出现错误

本文发布于:2023-11-14 04:24:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586209.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出现错误   DotNet   Standard   Net   WebJob

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!