How to use #load in scriptcs for an Azure function

246 Views Asked by At

I downloaded the code of an Azure Function created in the portal. Now I'm tryng to load a class in the main file (run.csx) using in the first line:

#load "..\shared\data.csx"

but i get the error:

 "run.csx(1,7): error CS1504: Source file '..\shared\data.csx' could not be opened -- Could not find file."

I added in the host.json:

"watchDirectories": [ "Shared" ]

I tried with uppercase, lowcase, put the class in the same folder of the run.csx but it doesn't work. I miss something?

1

There are 1 best solutions below

3
On

Double check that your "Shared" folder is under D:\home\site\wwwroot\Shared. Note that the root of your function app is at D:\home\site\wwwroot.