0

I have been developing an azure function that Would receive encrypted data and do some operations on this data and then return. I am however having an issue with the Microsoft SEAL Nuget package. When I run my function Locally there is no issue and I can use the package, however when I publish my function to azure I get a warning saying:

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 ==========

The Function still publishes to azure,however When I try and send a request, I receive an error 500, this is only when using the SEAL functionality. When I check the function insights on azure the failure is giving the error : Could not load file or assembly 'SEALNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' From my research I think it may be a dependency issue however I am unable to solve this. Thanks in advance if I have not formatted this correctly Edits are welcome.

k.dog
  • 35
  • 1
  • 1
  • 7

1 Answers1

0

According to the error message:

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"

Try defining the following setting in your .csproj:

<PlatformTarget>x64</PlatformTarget>
Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • Thanks for the Response! I added this to my .csproj however I am now receiving a "function host not running" message when I send a request to the function. Thanks. – k.dog Feb 04 '20 at 19:31
  • you'd better check log stream. Seems that it did not compile / executed properly. If you have this kind of problem, maybe a better approach would be dockerize everything and run on Container Instance, then use an azure function just to call ACI – Thiago Custodio Feb 04 '20 at 19:32
  • Thank you for the feedback, I will look into it. I am only new using azure and I was hoping to be able to simply publish the app from VS with the installed nuget,and then send requests from my WebApp. – k.dog Feb 05 '20 at 02:18