Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. NuGet Packages and Library Files

NuGet Packages and Library Files

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdotnetvisual-studioquestion
7 Posts 4 Posters 19 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #1

    I'd like to put all of my custom classes into a .NET Framework DLL so that I can share them among many different executables. If I install a NuGet package to the DLL, are the classes in that package supposed to be available to any EXE that holds a reference to the DLL? Or NuGet packages can't be shared that way, meaning the package must be installed to the EXE, not the shared library?

    The difficult we do right away... ...the impossible takes slightly longer.

    L D M 3 Replies Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      I'd like to put all of my custom classes into a .NET Framework DLL so that I can share them among many different executables. If I install a NuGet package to the DLL, are the classes in that package supposed to be available to any EXE that holds a reference to the DLL? Or NuGet packages can't be shared that way, meaning the package must be installed to the EXE, not the shared library?

      The difficult we do right away... ...the impossible takes slightly longer.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      In my experience, NuGet packages are on a project basis (dll; exe), though you can manage them at the solution and project level. You can "share" a dll's Nuget package via the dll as an "interface"; otherwise, I know of no way to surface "name spaces" from a dll other than the one it "owns".

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      Richard Andrew x64R 1 Reply Last reply
      0
      • L Lost User

        In my experience, NuGet packages are on a project basis (dll; exe), though you can manage them at the solution and project level. You can "share" a dll's Nuget package via the dll as an "interface"; otherwise, I know of no way to surface "name spaces" from a dll other than the one it "owns".

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        Thanks for the response, Gerry. Can you elaborate on what you mean by sharing the package as an interface? Do you mean I'd have to write code (interfaces) that specifically expose the types in the NuGet package?

        The difficult we do right away... ...the impossible takes slightly longer.

        L 1 Reply Last reply
        0
        • Richard Andrew x64R Richard Andrew x64

          I'd like to put all of my custom classes into a .NET Framework DLL so that I can share them among many different executables. If I install a NuGet package to the DLL, are the classes in that package supposed to be available to any EXE that holds a reference to the DLL? Or NuGet packages can't be shared that way, meaning the package must be installed to the EXE, not the shared library?

          The difficult we do right away... ...the impossible takes slightly longer.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          When you use or deploy the .DLL to another .EXE project, you have to ship the .DLL's in the NuGet package with your .DLL. Your .DLL won't work without them. As for being available to the .EXE, yes, the NuGet .DLL's will also be available to the executable project, just like they were for your .DLL project.

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
          Dave Kreskowiak

          Richard Andrew x64R 1 Reply Last reply
          0
          • D Dave Kreskowiak

            When you use or deploy the .DLL to another .EXE project, you have to ship the .DLL's in the NuGet package with your .DLL. Your .DLL won't work without them. As for being available to the .EXE, yes, the NuGet .DLL's will also be available to the executable project, just like they were for your .DLL project.

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
            Dave Kreskowiak

            Richard Andrew x64R Offline
            Richard Andrew x64R Offline
            Richard Andrew x64
            wrote on last edited by
            #5

            OK, thanks Dave.

            The difficult we do right away... ...the impossible takes slightly longer.

            1 Reply Last reply
            0
            • Richard Andrew x64R Richard Andrew x64

              Thanks for the response, Gerry. Can you elaborate on what you mean by sharing the package as an interface? Do you mean I'd have to write code (interfaces) that specifically expose the types in the NuGet package?

              The difficult we do right away... ...the impossible takes slightly longer.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Yes. A proxy.

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              1 Reply Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                I'd like to put all of my custom classes into a .NET Framework DLL so that I can share them among many different executables. If I install a NuGet package to the DLL, are the classes in that package supposed to be available to any EXE that holds a reference to the DLL? Or NuGet packages can't be shared that way, meaning the package must be installed to the EXE, not the shared library?

                The difficult we do right away... ...the impossible takes slightly longer.

                M Offline
                M Offline
                Mirza Ahmed Ali Baig
                wrote on last edited by
                #7

                The classes and functionality from the NuGet package won't be automatically available to the executables (EXE files) that reference this DLL. Each executable project that uses the DLL must also have its own references to the required NuGet packages.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups