2017-03-17 52 views
1

我很努力地从Visual Studio 2017中的.Net 4.6.2 azure服务结构statefulservice程序集调用.netstandard dll [在Windows 7上]。我在最新版本的服务结构[5.4.164.9494和SF SDK版本:2.4.164.9494]从.net调用.Netstandard dll 4.6.2 azure服务结构状态组装

遵循Using .net standard 1.5 lib in .net 4.6.2 misses System.Runtime 4.1.0.0中提到的确切步骤。尝试了多种方式,比如从.net核心,.Net标准和普通的旧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() 

     " 
    } 
} 

任何帮助表示赞赏..

+0

repo位于@ [github](https://github.com/ teeboy75/Servicefabric-Error) – teeboy

回答

0

你运行一个与Windows Server 2012R2或2016的SF群集? Azure门户的默认选项仍然是2012R2,并且只有.NET 4.5.1,除非您自己安装4.6.2(手动或通过脚本)

+0

这是Windows 7上的本地开发群集。 – teeboy

相关问题