1

I have created Blob Triggered Azure Function. I have added some DLLs in a folder named "ExternalAssemblies". If I have 3 DLLs in that folder I have to reference them with following lines at the top of my function:

#r "..\ExternalAssemblies\Assembly1.dll"
#r "..\ExternalAssemblies\Assembly2.dll"
#r "..\ExternalAssemblies\Assembly3.dll"

This became very tedious when I have many DLLs.

Is there any way by which I can just reference the "ExternalAssemblies" folder and all DLLs in it gets referred?

Thank You

Jerry Liu
  • 17,282
  • 4
  • 40
  • 61
Yash
  • 356
  • 1
  • 5
  • 22
  • Do you mind accepting the suggestion since it's by design that we are not able to load the folder for convenience? – Jerry Liu Jan 06 '19 at 03:48

1 Answers1

1

AFAIK there's no such method to load the folder instead of assemblies inside.

If ExternalAssemblies are custom assemblies, we may have to rely on the tedious directives. If the assemblies are from Nuget packages, we could turn to project.json to install them. Click View files on the right of function code panel, Add new file project.json with structure below. Don't forget to remove #r directives which are invalid for Nuget installed packages.

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "<Nuget package name>": "<Version>"
      }
    }
   }
}
Jerry Liu
  • 17,282
  • 4
  • 40
  • 61