Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETStandard Class Library - How to build/deploy a class library with all dependencies included? #8083

Closed
danmoseley opened this issue Apr 6, 2017 · 5 comments

Comments

@danmoseley
Copy link
Member

@dfarrNTST commented on Thu Apr 06 2017

Sorry if this is the wrong repo to put this in...let me know and we'll move it.

We have plugin applications that we allow developers to write modules/plugin Class Libraries and drop them into certain folders for our host applications to load. In .NET Framework this worked very well because after doing a Build on a class library project, all DLL's (including NuGet package references) were put into the bin folder and we could copy the contents of bin into the plugin/module folder. We must have this same functionality in NETStandard/.Net Core.

We've tried this in a NETStandard Class Library targeting netstandard1.4...we've added a few NuGet packages and another project reference to this class library. After each build, the only files in bin/Debug/netstandard1.4 are the Class Library DLL, the project reference DLL, and the deps json file. The NuGet packages DLL's are not included. We cannot put the NuGet references in the Host application. How do we get ALL DLL references to be put in the bin/Debug/netstandard1.4 folder? We've also tried Publish which just creates a NuGet package. We need ALL DLL's in the output folder for our build process so we can automate the copying of the full plugin/module code.

Is there a way to force the creation of all DLL's in the target framework bin folder on Build? If not, is this on the roadmap to be included. This is the last and only impediment for us to move to NETStandard/.Net Core.

@livarcocc
Copy link
Contributor

You can set <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> in your project to get the dlls copied from the NuGet cache to the output of your project.

@dfarrNTST
Copy link

This worked, thank you. Will they add this to VS in the future?

@dasMulli
Copy link
Contributor

dasMulli commented Apr 6, 2017

Also, you are able to dotnet publish your library which will include all NuGet dlls.

@springy76
Copy link

Where is the official documentation about <CopyLocalLockFileAssemblies>? Why I only find references on github, stackoverflow and misc blogs for so many properties? What is the name of the new csproj format other than "the new csproj format"?

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@MSDNAndi
Copy link

MSDNAndi commented Nov 14, 2022

Where is the official documentation about <CopyLocalLockFileAssemblies>? Why I only find references on github, stackoverflow and misc blogs for so many properties? What is the name of the new csproj format other than "the new csproj format"?

https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props
it is documented here at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants