C
C#2y ago
lindeberg.

❔ .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
Suiram1
Suiram12y ago
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.
Aaron
Aaron2y ago
is this like, a chatgpt output
arion
arion2y ago
".NET", "NuGet" and proper comma usage, definitely reasonable to assume <:poi_shrug:582941309174546569>
lindeberg.
lindeberg.2y ago
I'm talking about specifically.NET framework assemblies Like System.Net.Http or System.Data Not others Like they are all already there
Suiram1
Suiram12y ago
For assemblies like this you can use assembly reference because these assemblies are already installed in .NET Framework.
lindeberg.
lindeberg.2y ago
Thanks!
Accord
Accord2y ago
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.