如何在脚本中使用#load来实现Azure功能

时间:2018-08-06 09:04:15

标签: c# .net azure azure-functions scriptcs

我下载了在门户中创建的Azure功能的代码。现在,我尝试在第一行中使用以下方法在主文件(run.csx)中加载一个类:

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

但是我得到了错误:

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

我在host.json中添加了

"watchDirectories": [ "Shared" ]

我尝试使用大写,小写字母,将类放在run.csx的同一文件夹中,但是它不起作用。我想念什么吗?

1 个答案:

答案 0 :(得分:1)

仔细检查您的“共享”文件夹是否位于D:\home\site\wwwroot\Shared下。请注意,功能应用程序的根目录位于D:\home\site\wwwroot