2

I am creating Service Fabric application, when i try to create service instance listeners i have this error: enter image description here

Only place where I have System.Runtime is in one of class libraries that are used by my Service Fabric Microservice.

<package id="System.Runtime" version="4.1.0" targetFramework="net461" />

There is nothing about System.Runtime in dependentAssembly in side of any App.config in my Solution.

Also I am confused why is error mentioning version 4.1.0.0 and version 4.0.0.0.

Filip Filipovic
  • 410
  • 3
  • 13
  • You need to make sure packages are in each project for reference, have you done this? – Trevor Jul 30 '20 at 18:10
  • 1
    You are probably missing a [redirect](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions) for version `4.0.0.0` in your app.config. You can debug this with [fusionlogs](https://learn.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer). Also try clean and build. – Preben Huybrechts Jul 30 '20 at 18:19
  • @Çöđěxěŕ I did add System.Runtime from Nuget in every of my projects if u asking that? – Filip Filipovic Jul 30 '20 at 18:36
  • @PrebenHuybrechts I tried adding dependentAssembly in app.config but still get same error. – Filip Filipovic Jul 30 '20 at 18:52
  • @FilipFilipovic, please try to run `gacutil /i System.Runtime.dll` of the nuget package `System.Runtime 4.1.0`. You can refer to [this similar issue](https://stackoverflow.com/questions/63019110/could-not-load-file-or-assembly-system-buffers-version-4-0-2-0/63031245#63031245). Please let us know if it helps or not. – Mr Qian Jul 31 '20 at 02:46
  • @PerryQian-MSFT I tried that, both solutions from [this question](https://stackoverflow.com/questions/62764744/could-not-load-file-or-assembly-system-runtime-compilerservices-unsafe/62770487#62770487) and it didn`t work. – Filip Filipovic Jul 31 '20 at 09:57

0 Answers0