Azure service fabric 从.net 4.6.2 azure服务结构有状态程序集调用.Netstandard dll

Azure service fabric 从.net 4.6.2 azure服务结构有状态程序集调用.Netstandard dll,azure-service-fabric,visual-studio-2017,.net-standard,Azure Service Fabric,Visual Studio 2017,.net Standard,我正在努力从Visual Studio 2017[在windows 7上]中的.Net 4.6.2 azure service fabric statefulservice程序集调用.netstandard dll。我使用的是最新版本的service fabric[5.4.164.9494和SF SDK版本:2.4.164.9494] 遵循中提到的确切步骤。尝试了多种方法,例如从.Net核心、.netstandard和普通旧PCL(从项目属性转换为.Net标准)创建netstandard类库。什

我正在努力从Visual Studio 2017[在windows 7上]中的.Net 4.6.2 azure service fabric statefulservice程序集调用.netstandard dll。我使用的是最新版本的service fabric[5.4.164.9494和SF SDK版本:2.4.164.9494]

遵循中提到的确切步骤。尝试了多种方法,例如从.Net核心、.netstandard和普通旧PCL(从项目属性转换为.Net标准)创建netstandard类库。什么都不管用。项目确实编译,但当我将项目部署到集群时,statefulservice从未初始化,这是日志中的错误

{
  "Timestamp": "2017-03-17T09:28:22.8026277-04:00",
  "ProviderName": "Microsoft-ServiceFabric-Services",
  "Id": 5,
  "Message": "RunAsync has failed for a stateful service replica.  Application Type Name: ServiceFabricTestType, Application Name: fabric:/ServiceFabricTest, Service Type Name: Stateful1Type, Service Name: fabric:/ServiceFabricTest/Stateful1, Partition Id: 17258b22-c015-4eec-8026-edd3e21fffc4, Replica Id: 131342308870035108, WasCancelled: False, Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    File name: 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
    File name: 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

       at Stateful1.Stateful1.<RunAsync>d__2.MoveNext()
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
       at Stateful1.Stateful1.RunAsync(CancellationToken cancellationToken)
       at Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase.Microsoft.ServiceFabric.Services.Runtime.IStatefulUserServiceReplica.RunAsync(CancellationToken cancellationToken)
       at Microsoft.ServiceFabric.Services.Runtime.StatefulServiceReplicaAdapter.<ExecuteRunAsync>d__12.MoveNext()

    ",
  "ProcessId": 22424,
  "Level": "Error",
  "Keywords": "0x0000F00000000000",
  "EventName": "StatefulRunAsyncFailure",
  "ActivityID": null,
  "RelatedActivityID": null,
  "Payload": {
    "applicationTypeName": "ServiceFabricTestType",
    "applicationName": "fabric:/ServiceFabricTest",
    "serviceTypeName": "Stateful1Type",
    "serviceName": "fabric:/ServiceFabricTest/Stateful1",
    "partitionId": "17258b22-c015-4eec-8026-edd3e21fffc4",
    "replicaId": 131342308870035108,
    "wasCanceled": false,
    "exception": "System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
      File name: 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
      File name: 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

      WRN: Assembly binding logging is turned OFF.
      To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
      Note: There is some performance penalty associated with assembly bind failure logging.
      To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

         at Stateful1.Stateful1.<RunAsync>d__2.MoveNext()
         at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
         at Stateful1.Stateful1.RunAsync(CancellationToken cancellationToken)
         at Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase.Microsoft.ServiceFabric.Services.Runtime.IStatefulUserServiceReplica.RunAsync(CancellationToken cancellationToken)
         at Microsoft.ServiceFabric.Services.Runtime.StatefulServiceReplicaAdapter.<ExecuteRunAsync>d__12.MoveNext()

      "
  }
}
{
“时间戳”:“2017-03-17T09:28:22.8026277-04:00”,
“ProviderName”:“Microsoft ServiceFabric服务”,
“Id”:5,
“信息”:"有状态服务副本的RunAsync失败。应用程序类型名称:ServiceFabrictType,应用程序名称:fabric:/ServiceFabrictTest,服务类型名称:Stateful1Type,服务名称:fabric:/ServiceFabricTest/Stateful1,分区Id:17258b22-c015-4eec-8026-EDD3E21FFC4,副本Id:131342308870035108,已取消:False,异常:System.IO.FileNotFoundException:无法加载文件或程序集“System.Runtime,Version=4.1.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件。
文件名:“System.Runtime,Version=4.1.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”-->System.IO.FileNotFoundException:无法加载文件或程序集“System.Runtime,Version=4.1.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件。
文件名:“System.Runtime,版本=4.1.0.0,区域性=neutral,PublicKeyToken=b03f5f7f11d50a3a”
警告:程序集绑定日志记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。
在Stateful1.Stateful1.d_u2.MoveNext()处
在System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&stateMachine)中
在Stateful1.Stateful1.RunAsync(CancellationToken CancellationToken)
位于Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase.Microsoft.ServiceFabric.Services.Runtime.IStatefulUserServiceReplica.RunAsync(CancellationToken CancellationToken)
在Microsoft.ServiceFabric.Services.Runtime.StatefulServiceReplicaAdapter.d_u12.MoveNext()中
",
“进程ID”:22424,
“级别”:“错误”,
“关键字”:“0x0000F00000000000”,
“EventName”:“StatefulRunAsyncFailure”,
“活动ID”:空,
“RelatedActivityID”:空,
“有效载荷”:{
“applicationTypeName”:“ServiceFabrictTestType”,
“应用程序名称”:“结构:/ServiceFabrictTest”,
“serviceTypeName”:“Stateful1Type”,
“serviceName”:“结构:/ServiceFabricTest/Stateful1”,
“分区ID”:“17258b22-c015-4eec-8026-EDD3E21FFC4”,
“复制ID”:131342308870035108,
“被取消”:假,
“异常”:“System.IO.FileNotFoundException:无法加载文件或程序集'System.Runtime,版本=4.1.1.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a'或其依赖项之一。系统找不到指定的文件。
文件名:“System.Runtime,Version=4.1.1.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”-->System.IO.FileNotFoundException:无法加载文件或程序集“System.Runtime,Version=4.1.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。系统找不到指定的文件。
文件名:“System.Runtime,版本=4.1.0.0,区域性=neutral,PublicKeyToken=b03f5f7f11d50a3a”
警告:程序集绑定日志记录已关闭。
要启用程序集绑定失败日志记录,请将注册表值[HKLM\Software\Microsoft\Fusion!EnableLog](DWORD)设置为1。
注意:程序集绑定失败日志记录会带来一些性能损失。
要关闭此功能,请删除注册表值[HKLM\Software\Microsoft\Fusion!EnableLog]。
在Stateful1.Stateful1.d_u2.MoveNext()处
在System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&stateMachine)中
在Stateful1.Stateful1.RunAsync(CancellationToken CancellationToken)
位于Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase.Microsoft.ServiceFabric.Services.Runtime.IStatefulUserServiceReplica.RunAsync(CancellationToken CancellationToken)
在Microsoft.ServiceFabric.Services.Runtime.StatefulServiceReplicaAdapter.d_u12.MoveNext()中
"
}
}

非常感谢您的帮助。

您是否正在使用Windows Server 2012R2或2016运行SF群集?Azure portal的默认选项仍然是2012R2,只有.NET 4.5.1,除非您自己安装4.6.2(手动或通过脚本安装)

您是使用Windows Server 2012R2还是2016运行SF群集?Azure portal的默认选项仍然是2012R2,只有.NET 4.5.1,除非您自己安装4.6.2(手动或通过脚本)

repo is locate@repo is locate@