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

Microsoft.Extensions.Http is not being copied #5701

Closed
santo998 opened this issue Nov 27, 2024 · 1 comment
Closed

Microsoft.Extensions.Http is not being copied #5701

santo998 opened this issue Nov 27, 2024 · 1 comment

Comments

@santo998
Copy link

Description

I have a DLL which uses Microsoft.Extensions.Http.

Then, I have a project which references my DLL.

When I run my project, it throws the exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.Extensions.Http, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
...

If I reference Microsoft.Extensions.Http nuget from my project, it doesn't.

But, I shouldn't have to, because it doesn't reference it directly.

I think making the nuget package being transitive or copying the Microsoft.Extensions.Http DLL in some way via nuget would resolve this, so that's why I'm creating this issue.

Reproduction Steps

Have a DLL which references Microsoft.Extensions.Http, implement some method which uses that nuget package and call that method from another project.

Expected behavior

The project runs

Actual behavior

Exception thrown

Regression?

No response

Known Workarounds

Including direct reference to the nuget package from the project

Configuration

I'm running .NET 8 and referencing Microsoft.Extensions.Http 9.0.0

Other information

No response

@santo998 santo998 added bug This issue describes a behavior which is not expected - a bug. untriaged labels Nov 27, 2024
@RussKie
Copy link
Member

RussKie commented Nov 27, 2024

Microsoft.Extensions.Http lives in https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.Extensions.Http

Just because one assembly references another assembly it doesn't mean the second assembly will be automagically included in the dependency graph. The NuGet package that contains the first assembly must declare a dependency on Microsoft.Extensions.Http, only then it will get included.

@RussKie RussKie closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2024
@RussKie RussKie removed the bug This issue describes a behavior which is not expected - a bug. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants