I am struggling to call a .netstandard dll from a .Net 4.6.2 azure service fabric statefulservice assembly in Visual Studio 2017 [on windows 7]. I am on latest version of service fabric [5.4.164.9494 and SF SDK version: 2.4.164.9494]
Followed the exact steps as mentioned in Using .net standard 1.5 lib in .net 4.6.2 misses System.Runtime 4.1.0.0. Tried multiple things like creating the netstandard class library from .Net core,.Netstandard and plain old PCL (converted to .net standard from project properties). Nothing works. The project does compile but when I deploy the project to the cluster, The statefulservice never get's initialized and this is the error in the log..
{
"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()
"
}
}
Any help is appreciated..