skip to Main Content

In some study project I have the task to add a reference to system com object, and I know it is dynamic library, but I absolutely don’t understand what the difference between com objects and nuget packages are. I don’t understand when we need use com objects, and when nuget packages.

I hope for an explanation between com objects and nuget packages, also I would like to see when we should use com objects and when nuget packages.

2

Answers


  1. COM is a decades-old component technology, originally (IIRC) created by Microsoft. It predates .NET and was originally intended to enable programmers to reuse libraries or extend existing applications. COM components were typically dll files, and were often written in C++ or Visual Basic.

    The protocol was binary, and you had to ‘register’ the component (in the Windows registry, IIRC). Registration was machine-wide and done by identifier, which meant that you could only have one version of a COM component installed on a machine.

    From a .NET developer’s perspective, I’d consider it a legacy technology.

    NuGet, on the other hand, is a package management system. In .NET, you can create reusable libraries (also dll files). While it’s possible to register a .NET library as a COM component (by implementing some special interfaces or something – I honestly no longer remember how one worked with it), you can also just copy the dll file to the folder where your .NET application runs, and it becomes available to that process.

    This means that you can have many versions of the same .NET library on the same machine. Application A uses version 1.1 of a library, while application B uses version 3.2.

    In the first years of .NET, you’d typically download reusable libraries as Zip files, unpack them, and copy them around as necessary.

    This did solve the ‘dll hell’ problem of COM, but was tedious and somewhat error-prone for other reasons. Thus, like in other languages, a package manager system emerged. This is called NuGet, and is similar to package managers for other languages/platforms.

    NuGet is a way to distribute and manage reusable libraries, most of which are .NET dlls.

    Login or Signup to reply.
  2. -> COM – Component Object Model, COM is binary interface and introduced by Microsoft.

    • COM objects are compiled code libraries(.dll files) that expose of interfaces throught which other application can connect with them.
    • COM objects are used for integrating with legacy systens or using in old technology components developed in like c++ languages and also use in Microsoft office applications or other Windows specific components.

    ->NutGet is package manager for .NET development and NuGet packages are managed by Visual Studio.

    • Nutget package are collection of compiled code and metadata in single file.
    • in Nutget package , version control in .net projects,handling installation, upgrading and removing of packages automatically.
    • if developing any appication, you can use easly third party community help of manage dependencies by nutget packages.
    • NutGet packages are use for modern .net development Workflows.
    • Nutget package allows to share application with other.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search