可用于 Azure Functions 的包是否有任何限制.我已经尽可能多地进行了研究,但似乎并非如此,但是当我尝试创建一个引用包Microsoft.ServiceFabric"的 Azure 函数时,我收到以下错误:
Are there any restrictions with packages you can use with Azure Functions. I have researched as much as I can and it doesn't seem so, however when I try creating an Azure Function that references the package "Microsoft.ServiceFabric" I get the following error:
System.Private.CoreLib:执行函数时出现异常:ScaleDownServiceFabrics.FunctionApp2:无法加载文件或程序集'System.Fabric,版本=6.0.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35'.无法找到或加载特定的文件.(来自 HRESULT 的异常:0x80131621).System.Private.CoreLib:无法加载文件或程序集'System.Fabric,版本 = 6.0.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35'.
System.Private.CoreLib: Exception while executing function: ScaleDownServiceFabrics. FunctionApp2: Could not load file or assembly 'System.Fabric, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Fabric, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
我尝试过 Azure Func 和 .1 和 2,以及 .Net Framework 和 .Net Core,但都没有成功.
I have tried both Azure Func and.1 and 2, and .Net Framework and .Net Core with no luck.
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;
using System.Fabric;
namespace FunctionApp5
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("*/5 * * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
FabricClient client = new FabricClient();
}
}
}
这是可能的,还是 Visual Studio 中 Azure Functions 的限制 - 如果是,哪些包是可以接受的?
Is this possible, or a limitation of Azure Functions in Visual Studio - if so, what packages are acceptable?
Microsoft.ServiceFabric
.Microsoft.ServiceFabric
最新版本 6.3.x 针对 .Net Standard 2.0
和 4.5
中的 .Net Framework
到 4.7.1
,请确保您在项目中使用了这些中的任何一个.Microsoft.ServiceFabric
DLL 复制到 bin 文件夹中.Microsoft.ServiceFabric
.Microsoft.ServiceFabric
latest version 6.3.x targets .Net Standard 2.0
and .Net Framework
from 4.5
to 4.7.1
, make sure you are using any of these on your project.Microsoft.ServiceFabric
DLLs are being copied to the bin folder when builtdeployed.这篇关于无法使用 Azure Functions 加载文件或程序集 System.Fabric的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!