core icon indicating copy to clipboard operation
core copied to clipboard

Add nuget packages to exported DLL files

Open Kool-Koder opened this issue 7 years ago • 7 comments

I have tested this with 2 types of project. 1 that is uncompiled and 1 that has been compiled to a dll. When I try to add to the uncompiled project, it works and I can run it. However in the folder with dll, as it can't detect any project, it refuses to download the nuget package. Is there anyway to circumvent this? Thank you very much!

dotnet add package AWSSDK.Core
Could not find any project in `/root/Desktop/OSPJ/netcoreapp2.2/`.
Error:
  An assembly specified in the application dependencies manifest (OSPJ New.deps.json) was not found:
    package: 'AWSSDK.Core', version: '3.3.103.13'
    path: 'lib/netstandard2.0/AWSSDK.Core.dll'

Kool-Koder avatar Jul 21 '19 17:07 Kool-Koder

@livarcocc @nguerrera is this something you guys can help with? Or should we send it to someone else?

carlossanlop avatar Jul 22 '19 18:07 carlossanlop

The add package command is for editing project files. It modifies the project by adding a package reference to it.

This behavior seems entirely by design.

livarcocc avatar Jul 22 '19 18:07 livarcocc

@Kool-Koder Can you provide more info about what you are trying to accomplish

How did you get the second error? Is this when trying to run app call "OSPJ New"? How was that app published and deployed?

nguerrera avatar Jul 22 '19 20:07 nguerrera

Hi, sorry for the late reply. I published using Visual Studio 2019, and set the configuration to release. I believe what is happening is the 3rd party NUGET packages such as AWS is not being exported together with the project and as such this error is happening. Thank you for your help.

Kool-Koder avatar Aug 03 '19 09:08 Kool-Koder

Can you provide a complete set of repro steps?

What does the csproj file look like?

Which menu options exactly did you use in VS 2019 to publish?

How did you get the app files get to /root/Desktop/OSPJ/netcoreapp2.2 on what I presume is a different Linux machine or container?

nguerrera avatar Aug 03 '19 12:08 nguerrera

In case this is what you tried, for .NET Core 2.x, you cannot simply build and copy the bin\ folder to another machine. Build will only copy enough files to develop on the current machine. You need to use Publish to copy all the NuGet dependencies.

nguerrera avatar Aug 03 '19 12:08 nguerrera

Closing due to +2 weeks of inactivity. @Kool-Koder ping us if you can provide answers for @nguerrera 's questions. We'll be happy to continue helping you.

carlossanlop avatar Aug 12 '19 21:08 carlossanlop