Azure / Azure/Azure-Functions

Referencing external assembly with native dependencies in Azure Function

Open
#622 45 comments 11 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I'm getting following exception when doing aforementioned:

`
2017-12-10T12:56:29.526 Function started (Id=22fce544-1d7f-4262-8c59-dcb962ac0bd1)2017-12-10T12:56:29.574 Exception during runtime resolution of assembly 'Affdex, Version=3.4.1.1320, Culture=neutral, PublicKeyToken=null': 'System.IO.FileLoadException: Could not load file or assembly 'Affdex, Version=3.4.1.1320, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019)File name: 'Affdex, Version=3.4.1.1320, Culture=neutral, PublicKeyToken=null' ---> System.IO.FileLoadException: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource) at System.Reflection.Assembly.Load(Byte[] rawAssembly) at Microsoft.Azure.WebJobs.Script.Description.FunctionMetadataResolver.ResolveAssembly(String assemblyName) in C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\FunctionMetadataResolver.cs:line 232 at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoadContext.ResolveAssembly(String name) in C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoadContext.cs:line 61 at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoader.ResolveAssembly(Object sender, ResolveEventArgs args) in C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoader.cs:line 60'2017-12-10T12:56:29.574 Unable to find assembly 'Affdex, Version=3.4.1.1320, Culture=neutral, PublicKeyToken=null'. Are you missing a private assembly file?2017-12-10T12:56:29.635 Exception while executing function: Functions.HttpTriggerCSharp1. mscorlib: Exception has been thrown by the target of an invocation. f-HttpTriggerCSharp1__-1535649923: Could not load file or assembly 'Affdex, Version=3.4.1.1320, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.2017-12-10T12:56:29.729 Function completed (Failure, Id=22fce544-1d7f-4262-8c59-dcb962ac0bd1, Duration=211ms)
`

**AffdexWrapper** is using .NET library **Affdex.dll** which is in turn using **affdex-native.dll** and **opencv_ffmpeg248.dll**. All for libraries are in the same folder in the root of the app. Affdex documentation mentions that it requires **Visual C++ Redistributable runtime for VS 2013**

Are there any solutions at this point of time?

Dovydas

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.