【发布时间】:2018-09-10 12:15:11
【问题描述】:
我目前正在使用在 Visual Studio 中创建的 Azure 函数。它是一个定时器函数,它调用一些通用代码来写入队列。
在本地运行代码不会导致任何问题。运行良好,但发布时出现以下错误:
无法加载文件或程序集“Microsoft.WindowsAzure.Storage, 版本=9.1.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35' 或 它的依赖项之一。系统找不到文件 指定。||System.IO.FileNotFoundException: 无法加载文件或 程序集'Microsoft.WindowsAzure.Storage,版本=9.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 或其之一 依赖关系。该系统找不到指定的文件。文件名: 'Microsoft.WindowsAzure.Storage,版本=9.1.0.0,文化=中性, PublicKeyToken=31bf3856ad364e35' 在 世界语.Core.Function.JobGetterLogic.SendJobsToQue() 在 JobGetter.TimedJob.Run(TimerInfo myTimer, TraceWriter 日志)
这是我的网络作业代码:
public static class TimedJob
{
[FunctionName("TimedJob")]
public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
try
{
var brain = new CoreLogic.Function.JobGetterLogic();
var result = brain.SendJobsToQue();
}
catch (Exception e)
{
log.Info(e.Message + "||" + e.ToString());
}
}
}
【问题讨论】:
-
The system cannot find the file specified,检查 dll 并查看它是否存在于正确/所需的目录中 -
@zackraiyan 我试图将 Azure 存储的 nuget 包添加到函数中,但它不会添加它。我还读到 azure 存储只是 azure 功能系统的一部分。
标签: c# azure azure-functions