❔ .NET Framework reference vs NuGet?
Hello! In a .NET-framework project I'm working in there are references to .NET assemblies both as references (<Reference Include="System.Net.Http" />) and NuGet (<PackageReference Include="System.Net.Http"> Version="xxx").
What are the differences between them?
Why do both ways exist?
Which one is better?
7 Replies
Both ways of adding references to .NET assemblies can be useful in different situations. File references are useful when you have a local copy of the assembly that you want to reference, or when you want to reference an assembly that is not available on NuGet. NuGet references are useful when you want to use a library or tool that is available on NuGet and you want to use the NuGet package manager to manage the version and updates.
It is generally considered better to use NuGet references when possible, because it makes it easier to manage the dependencies of your project and ensures that the correct version of the assembly is always used. However, there may be cases where it is necessary or more convenient to use file references.
is this like, a chatgpt output
".NET", "NuGet" and proper comma usage, definitely reasonable to assume <:poi_shrug:582941309174546569>
I'm talking about specifically.NET framework assemblies
Like System.Net.Http or System.Data
Not others
Like they are all already there
For assemblies like this you can use assembly reference because these assemblies are already installed in .NET Framework.
Thanks!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.