C# Azure Function in Dll doesn't work in Azure (but in emulator) C# Azure Function in Dll doesn't work in Azure (but in emulator) azure azure

C# Azure Function in Dll doesn't work in Azure (but in emulator)


This will be fully supported on the next release of the runtime ( > 1.0.10690).

You can find more information about that enhancement here

The reason you observed the different behavior when running locally is because the CLI preview is (unfortunately) ahead of the hosted environment at this point and using the new runtime bits. We're changing the process to ensure those releases are in lockstep with each other moving forward.


I had to put the dlls in the same directory as the function.json and remove the directory prefix from scriptFile. I was unable to get it to work in a subdirectory.

A workaround in which I'm able to get it to work in a subdirectory is to use a run.csx file that imports the .dll and just executes the static method in that dll. Such as:

#r "DLLs\MyFunction.dll"using System;public static void Run(string myEventHubMessage, TraceWriter log){    MyFunction.Program.Run(myEventHubMessage, log);}

(In this example I was using an eventHubTrigger)