0

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

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' 根据我的研究,我认为这可能是一个依赖问题,但我无法解决这个问题。如果我没有正确格式化,请提前感谢 欢迎编辑。

4

1 回答 1

0

根据错误信息:

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

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

<PlatformTarget>x64</PlatformTarget>
于 2020-02-04T18:55:49.407 回答