I use an Azure v1 Function (C#, .NET Framework 4.6.1) to call an external WCF service and for making this work, I added a reference to the System.ServiceModel assembly. This works fine on my local dev machine, but after deploying the function to Azure, I get the following error:
Error: Unable to load one or more of the requested types. Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
I tried adding the dll as a local copy/directly to live binary with app service editor, but this caused another error:
... (as above) Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context.
The same error occurs when I remove the assembly reference and install nuget package System.ServiceModel.Primitives instead.