1
votes

I'm trying to add a dependency on an external assembly to an Azure Function developed and published from Visual Studio 2017. On Azure Functions developed on the Portal, I can add dependencies as as normal using #r and referencing a .dll in the Function directory. In Visual Studio, I get "the reference is invalid or unsupported" if I try to reference the same .dll on my local machine (which makes sense), and it doesn't let me reference assemblies not present on my local machine but present in the Function directory (which also makes sense). So the question is, how can I add assembly references to an Azure Function developed on Visual Studio? Am I missing something obvious?

(N.B. there are other reasons prohibiting just copying the function over and developing it entirely on the Portal, so that isn't an option)

1

1 Answers

8
votes

Function App in Visual Studio 2017 is just a Class Library project. You should be able to reference other assemblies the usual way for such projects: either by adding a NuGet package, or via Add Reference dialog.