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. Deploying a .NET App with Nuget Dependencies

Deploying a .NET App with Nuget Dependencies

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdotnetvisual-studiosysadmincloud
6 Posts 3 Posters 0 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.
  • T Offline
    T Offline
    TNCaver
    wrote on last edited by
    #1

    When creating a .NET Framework 4.7.2 class library that uses a lot of Microsoft's NuGet packages, and creating an internal NuGet package from the library, is there a way to wrap all those MS packages into the library so that they aren't all required in apps built using my library? Background: I've got a legacy .NET Framework 4.7.2 console app, initially deployed a few years ago to an app server using a setup project. Updates and enhancements were deployed by merely copying the exe to the installation location, as well as any new DLLs the enhancements required. We recently decided to have all our internal applications write their logs to Application Insights in Azure, so I created a .NET Framework 4.7.2 class library with this functionality, and added the 20-odd NuGet packages required (this overhead is insane) to support writing to AI. I built my own NuGet package for this library, uploaded it to our DevOps Artifacts. Then I added my package to the legacy app, and when I built the app it added all those MS DLLs to the obj/Release folder. I copied the new DLLs and the new exe to the deployed folder on the server, but running it fails as it can't find the MS DLLs. Setup projects are no longer supported (why???), so I don't know how to get this to work. Any ideas?

    If you think 'goto' is evil, try writing an Assembly program without JMP.

    L R 2 Replies Last reply
    0
    • T TNCaver

      When creating a .NET Framework 4.7.2 class library that uses a lot of Microsoft's NuGet packages, and creating an internal NuGet package from the library, is there a way to wrap all those MS packages into the library so that they aren't all required in apps built using my library? Background: I've got a legacy .NET Framework 4.7.2 console app, initially deployed a few years ago to an app server using a setup project. Updates and enhancements were deployed by merely copying the exe to the installation location, as well as any new DLLs the enhancements required. We recently decided to have all our internal applications write their logs to Application Insights in Azure, so I created a .NET Framework 4.7.2 class library with this functionality, and added the 20-odd NuGet packages required (this overhead is insane) to support writing to AI. I built my own NuGet package for this library, uploaded it to our DevOps Artifacts. Then I added my package to the legacy app, and when I built the app it added all those MS DLLs to the obj/Release folder. I copied the new DLLs and the new exe to the deployed folder on the server, but running it fails as it can't find the MS DLLs. Setup projects are no longer supported (why???), so I don't know how to get this to work. Any ideas?

      If you think 'goto' is evil, try writing an Assembly program without JMP.

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

      Would have stuck with the EXE. Create a (web) server for handling the logging to Azure; your apps talk to the server instead of "NuGet", etc.

      It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

      1 Reply Last reply
      0
      • T TNCaver

        When creating a .NET Framework 4.7.2 class library that uses a lot of Microsoft's NuGet packages, and creating an internal NuGet package from the library, is there a way to wrap all those MS packages into the library so that they aren't all required in apps built using my library? Background: I've got a legacy .NET Framework 4.7.2 console app, initially deployed a few years ago to an app server using a setup project. Updates and enhancements were deployed by merely copying the exe to the installation location, as well as any new DLLs the enhancements required. We recently decided to have all our internal applications write their logs to Application Insights in Azure, so I created a .NET Framework 4.7.2 class library with this functionality, and added the 20-odd NuGet packages required (this overhead is insane) to support writing to AI. I built my own NuGet package for this library, uploaded it to our DevOps Artifacts. Then I added my package to the legacy app, and when I built the app it added all those MS DLLs to the obj/Release folder. I copied the new DLLs and the new exe to the deployed folder on the server, but running it fails as it can't find the MS DLLs. Setup projects are no longer supported (why???), so I don't know how to get this to work. Any ideas?

        If you think 'goto' is evil, try writing an Assembly program without JMP.

        R Offline
        R Offline
        Richard Deeming
        wrote on last edited by
        #3

        TNCaver wrote:

        running it fails as it can't find the MS DLLs

        That's the problem you need to fix, but unfortunately you haven't provided enough information about it. You need to get the full exception details to try to diagnose the problem.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        T 1 Reply Last reply
        0
        • R Richard Deeming

          TNCaver wrote:

          running it fails as it can't find the MS DLLs

          That's the problem you need to fix, but unfortunately you haven't provided enough information about it. You need to get the full exception details to try to diagnose the problem.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          T Offline
          T Offline
          TNCaver
          wrote on last edited by
          #4

          System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

          If you think 'goto' is evil, try writing an Assembly program without JMP.

          R 1 Reply Last reply
          0
          • T TNCaver

            System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

            If you think 'goto' is evil, try writing an Assembly program without JMP.

            R Offline
            R Offline
            Richard Deeming
            wrote on last edited by
            #5

            Double-check that the folder your app is running from contains Microsoft.Extensions.DependencyInjection.Abstractions.dll, and that its version is precisely 5.0.0.0. v5 of that library[^] doesn't have any additional dependencies, so either the file is missing, or you've got the wrong version.


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            T 1 Reply Last reply
            0
            • R Richard Deeming

              Double-check that the folder your app is running from contains Microsoft.Extensions.DependencyInjection.Abstractions.dll, and that its version is precisely 5.0.0.0. v5 of that library[^] doesn't have any additional dependencies, so either the file is missing, or you've got the wrong version.


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              T Offline
              T Offline
              TNCaver
              wrote on last edited by
              #6

              Yep, did that at the beginning of my troubleshooting. All 20 package DLLs are in the same folder as the exe, just as all the previous DLLs it has been using all along have been. All the correct versions, copied from the obj\x64\Release folder where they were pushed to when I built the project.

              If you think 'goto' is evil, try writing an Assembly program without JMP.

              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