Azure функция не может загрузить пакет Nuget - работает локально - PullRequest
0 голосов
/ 04 февраля 2020

Я занимаюсь разработкой функции azure, которая будет принимать зашифрованные данные, выполнять некоторые операции с этими данными и затем возвращать их. Однако у меня возникла проблема с пакетом Microsoft SEAL Nuget. Когда я запускаю свою функцию локально, проблем нет, и я могу использовать пакет, однако, когда я публикую sh свою функцию на 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' Из моего исследования я думаю, что это может быть проблема зависимости, однако я не могу решить эту проблему. Спасибо заранее, если я не отформатировал это правильно. Редактирование приветствуется.

1 Ответ

0 голосов
/ 04 февраля 2020

Согласно сообщению об ошибке:

Произошло несоответствие между архитектурой процессора создаваемого проекта "MSIL" и эталонной архитектурой процессора "C: \ Users \ Kyle .nuget \ packages \ microsoft.research.sealnet \ 3.4.5 \ lib \ netstandard2.0 \ SEA LNet .dll "," AMD64 "

Попробуйте определить следующий параметр в .csproj :

<PlatformTarget>x64</PlatformTarget>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...