2017-03-17 97 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

相關問題