Azure函数 - Nuget软件包已下载但未在运行时找到 - Autofac 4.4.0

时间:2017-03-12 23:43:50

标签: azure nuget azure-functions

我再次遇到预编译函数的问题 - 这次是Nuget包依赖。

我添加了一个project.json文件,我的依赖项(Autofac 4.4.0)已成功恢复 - 通过日志确认。

在运行我的预编译函数时,Autofac依赖项会导致抛出异常。我试过重启等等。

请参阅日志提取:

2017-03-08T11:23:20.540 Restoring packages. 2017-03-08T11:23:20.540 Starting NuGet restore 2017-03-08T11:23:23.044 Restoring packages for D:\home\site\wwwroot\FindNewFairplayXmlFiles\project.json... 2017-03-08T11:23:23.790 GET https://api.nuget.org/v3-flatcontainer/autofac/index.json 2017-03-08T11:23:24.727 OK https://api.nuget.org/v3-flatcontainer/autofac/index.json 942ms 2017-03-08T11:23:24.790 GET https://api.nuget.org/v3-flatcontainer/autofac/4.4.0/autofac.4.4.0.nupkg 2017-03-08T11:23:25.717 OK https://api.nuget.org/v3-flatcontainer/autofac/4.4.0/autofac.4.4.0.nupkg 926ms 2017-03-08T11:23:26.809 Installing Autofac 4.4.0. 2017-03-08T11:23:30.230 Committing restore... 2017-03-08T11:23:30.246 Writing lock file to disk. Path: D:\home\site\wwwroot\FindNewFairplayXmlFiles\project.lock.json 2017-03-08T11:23:30.420 D:\home\site\wwwroot\FindNewFairplayXmlFiles\project.json 2017-03-08T11:23:30.420 Restore completed in 7614ms. 2017-03-08T11:23:30.464 2017-03-08T11:23:30.464 NuGet Config files used: 2017-03-08T11:23:30.464 C:\DWASFiles\Sites\acutefunc\AppData\NuGet\NuGet.Config 2017-03-08T11:23:30.464 2017-03-08T11:23:30.464 Feeds used: 2017-03-08T11:23:30.464 https://api.nuget.org/v3/index.json 2017-03-08T11:23:30.511 2017-03-08T11:23:30.511 Installed: 2017-03-08T11:23:30.511 1 package(s) to D:\home\site\wwwroot\FindNewFairplayXmlFiles\project.json 2017-03-08T11:23:30.558 2017-03-08T11:23:30.558 2017-03-08T11:23:30.823 Packages restored. 2017-03-08T11:23:31.151 Script for function 'FindNewFairplayXmlFiles' changed. Reloading. 2017-03-08T11:23:31.151 Compilation succeeded. 2017-03-08T11:24:37.960 Function started (Id=9c8e8e66-0419-43a7-8b81-a30e6a138b72) 2017-03-08T11:24:38.007 Function completed (Failure, Id=9c8e8e66-0419-43a7-8b81-a30e6a138b72) 2017-03-08T11:24:38.054 Exception while executing function: Functions.FindNewFairplayXmlFiles. mscorlib: Exception has been thrown by the target of an invocation. Acute.Compiled.Functions: Could not load file or assembly 'Autofac, Version=4.4.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The system cannot find the file specified.

1 个答案:

答案 0 :(得分:2)

也将这些信息添加到您的GitHub问题中,但是对于预编译的场景,包引用(对于动态编译的函数来说是一个编译功能)不起作用,您需要发布/部署程序集编译中的构建工件,包括依赖项。

请确保使用预编译的功能组件部署所需的程序集,然后再试一次。