Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly System.Net.Http.Formatting, Version=6.0.0.0 #3829

Open
Eliran-Turgeman opened this issue Sep 19, 2024 · 0 comments

Comments

@Eliran-Turgeman
Copy link

Version

4.0.6280 (latest, at the time of writing)

Description

I am using azure function app version 4, with .NET 8 in process mode, functions SDK version is 4.4.0.

One of the dependencies of my project is Microsoft.AspNet.WebApi.Client Version 6.0.0 (which includes the dll for System.Net.Http.Formatting (also in version 6.0.0)

When I try to run the function locally/deploy it, I get the same error -

Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. System.Private.CoreLib: Unable to load one or more of the requested types. Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified. Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

The dll of version 6.0.0 is in the function app - verified through Kudu, and by downloading the site content.

I think that our app first loads the azure-functions-core-tools dll with version 5.2.8, and by the time we try to load the correct dll with version 6.0.0 it fails because there was already an assembly with the same name loaded.

I think the fix here could be a new version of the tool with a bump to Microsoft.AspNet.WebApi.Client to version 6.0.0

Steps to reproduce

  • create a .net project
  • make Microsoft.AspNet.WebApi.Client Version 6.0.0 a dependency
  • upload project to an azure function (azure function version 4, in process mode, functions sdk version is 4.4.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant