Add nuget packages to exported DLL files
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'
@livarcocc @nguerrera is this something you guys can help with? Or should we send it to someone else?
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.
@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?
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.
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?
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.
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.