繁体   English   中英

Azure 函数无法加载 Nuget 包 - 在本地工作

[英]Azure function failing to Load Nuget package - Working locally

我一直在开发一个 azure 函数,它会接收加密数据并对这些数据进行一些操作,然后返回。 但是,我遇到了 Microsoft SEAL Nuget 包的问题。 当我在本地运行我的函数时,没有问题,我可以使用该包,但是当我将我的函数发布到 azure 时,我收到一条警告:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\Kyle\.nuget\packages\microsoft.research.sealnet\3.4.5\lib\netstandard2.0\SEALNet.dll", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
1>FunctionApp3 -> C:\Users\Kyle\source\repos\FunctionApp3\bin\Release\netcoreapp3.0\bin\FunctionApp3.dll
1>Done building project "FunctionApp3.csproj".
2>------ Publish started: Project: FunctionApp3, Configuration: Release Any CPU ------
2>There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\Kyle\.nuget\packages\microsoft.research.sealnet\3.4.5\lib\netstandard2.0\SEALNet.dll", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
2>FunctionApp3 -> C:\Users\Kyle\source\repos\FunctionApp3\bin\Release\netcoreapp3.0\bin\FunctionApp3.dll
2>FunctionApp3 -> C:\Users\Kyle\source\repos\FunctionApp3\obj\Release\netcoreapp3.0\PubTmp\Out\
2>    Could not evaluate 'sealnetnative.dll' for extension metadata. Exception message: Bad IL format.
2>Publishing C:\Users\Kyle\source\repos\FunctionApp3\obj\Release\netcoreapp3.0\PubTmp\FunctionApp3 - 2020020416504394.zip to https://functionapp320200204042055.scm.azurewebsites.net/api/zipdeploy...
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

该函数仍然发布到 azure,但是当我尝试发送请求时,我收到错误 500,这仅在使用 SEAL 功能时。 当我检查 azure 上的函数见解时,失败给出了错误: Could not load file or assembly 'SEALNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'从我的研究来看,我认为这可能是一个依赖性问题我无法解决这个问题。 如果我没有正确格式化,请提前致谢,欢迎编辑。

根据错误信息:

正在构建的项目的处理器架构“MSIL”与参考的处理器架构“C:\\Users\\Kyle.nuget\\packages\\microsoft.research.sealnet\\3.4.5\\lib\\netstandard2.0”之间存在不匹配\\SEALNet.dll", "AMD64"

尝试在 .csproj 中定义以下设置:

<PlatformTarget>x64</PlatformTarget>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM