I am deploying a function and I am able to build and publish it successfully in a function app V2 from Visual studio, but in the azure portal I see the below message inside my function app. I have added the necessary package but still its of no use. Has anyone come across this error and have any feedback. There is no error in the Output window of Visual studio as well.
If I remove this version of abstraction then it says file not found with version 3.1.5. When i add the version 3.1.5 then it says file not found. No clue what is wrong. there is a discussion in github but that thread is closed now without much information
Thanks
System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb97829ddae60'. The system cannot find the file specified. System.Private.CoreLib: Could not load the specified file.
I have just come across a similar issue. For me the problem was I had included one of the Microsoft.Extensions.xxx
packages with Version="5.0.0"
but my target framework was netcoreapp3.1
.
Changing the version of the referenced extension package to the same as my target framework resolved the error.
E.g.
Change:
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
To:
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.10" />
The real problem was I ran dotnet add package Microsoft.Extensions.xxx
without specifying the version so it just added the latest available.
I fixed it by changing the Function runtime version. It was set to ~2 . I changed it to ~3 and that made the error go away.
You can do it in Function App -> Configuration -> Function runtime
I had the issue too, The changed the version to 2.1.1 and it works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With