Azure 函数不会自动加载 nuget 程序集
Azure function doesn't automatically load nuget assemblies
我已经用自定义程序集创建了 nuget 包。它安装得很好,但是根据文档
,函数 运行 没有加载程序集。
When you upload a project.json file, the runtime gets the packages and
automatically adds references to the package assemblies. You don't
need to add #r "AssemblyName" directives. Just add the required using
statements to your run.csx file to use the types defined in the NuGet
packages.
因此,任何包含来自我的包的名称空间的 using 语句只会使函数无法编译。
程序集针对 .net 4.6.1 是一个问题,我可以读到函数仅支持项目 json 的 4.6。
如果我使用#r "......\data\Functions\packages\nuget\letsencrypt.azure.core[=22=].6.16-prerelease\lib\net461\LetsEncrypt.[= 引用程序集,我可以加载它24=]"
然而,这只会导致来自 nuget 的所有其他依赖项也丢失。我必须手动引用每个 nuget 才能正常工作,这真的是真的吗?
事实证明,如果您以 4.6.1 为目标,这是一个问题。当我将其更改为 4.6 时,它现在似乎可以正常工作。
我已经用自定义程序集创建了 nuget 包。它安装得很好,但是根据文档
,函数 运行 没有加载程序集。When you upload a project.json file, the runtime gets the packages and automatically adds references to the package assemblies. You don't need to add #r "AssemblyName" directives. Just add the required using statements to your run.csx file to use the types defined in the NuGet packages.
因此,任何包含来自我的包的名称空间的 using 语句只会使函数无法编译。
程序集针对 .net 4.6.1 是一个问题,我可以读到函数仅支持项目 json 的 4.6。
如果我使用#r "......\data\Functions\packages\nuget\letsencrypt.azure.core[=22=].6.16-prerelease\lib\net461\LetsEncrypt.[= 引用程序集,我可以加载它24=]"
然而,这只会导致来自 nuget 的所有其他依赖项也丢失。我必须手动引用每个 nuget 才能正常工作,这真的是真的吗?
事实证明,如果您以 4.6.1 为目标,这是一个问题。当我将其更改为 4.6 时,它现在似乎可以正常工作。