Skip to content

NuGet package is not created correctly when there is project dependency #1261

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

Closed
Sinstraliz opened this issue Jan 27, 2016 · 6 comments
Closed

Comments

@Sinstraliz
Copy link

Hi,

I think there is a problem with the creation of the NuGet packages when there is a project dependency. I am using dnx version "1.0.0-rc1-update1". I have specified the type of the dependency as "build" and the target is "project" but when I go to the produced NuGet packages the dlls of the dependent project are missing from the package. If I set the dependency type to "default" the build produces two NuGet packages and the dependency is include as NuGet package reference in the main NuGet but I don't need to produce NuGet packages for both projects I need only a NuGet for the main project and include the dlls from the second project to the main project's NuGet package. I don't know if this is possible at the moment. It will be great if someone can help me set this up. Again if it is even possible. I am sorry if this is not the place for this issue but I didn't know where to put it.

@mynkow
Copy link

mynkow commented Jan 28, 2016

+1

@davidfowl
Copy link
Member

You should have 2 packages. Embedding more than one dll inside of a package isn't supported. Putting more than one dll in a package is sorta of a no no when it comes to nuget. Since nuget doesn't look at DLL dependencies, it's easy to get into version hell if you put multiple dlls that can potentially show up in multiple packages.

Also, the build modifier is doing what it's supposed to do. If you have it it removes the dependency from your nupkg.

@Sinstraliz
Copy link
Author

Ok I guess then it is not possible to create a single nupkg for a solution it must be per project. Are you thinking in future to add this capability(single nupkg per solution) or maybe just when you set the "type" modifier of the dependency to "build" to just add the dlls to the nupkg or add some other setting about this? I think it will be common for people to try to do this. In my case I have a few classes that are in a separate project and they are simple models that I am using and the way that is at the moment forces me to publish a separate nupkg for this or create the nupkg myself.

@davidfowl
Copy link
Member

Are you thinking in future to add this capability(single nupkg per solution) or maybe just when you set the "type" modifier of the dependency to "build" to just add the dlls to the nupkg or add some other setting about this?

No. You should make multiple projects. Think of nuget packages as the new dll. You get a package for DLL, when representing libraries.

I think it will be common for people to try to do this. In my case I have a few classes that are in a separate project and they are simple models that I am using and the way that is at the moment forces me to publish a separate nupkg for this or create the nupkg myself.

If you want to share a few classes then there's other ways to do that, like shared projects. https://github.com/aspnet/Common/blob/dev/src/Microsoft.Extensions.ActivatorUtilities.Sources/project.json#L3

@Sinstraliz
Copy link
Author

Thank you for the quick response I will have to check this and see if it will work in our case.

@aspnet-hello
Copy link

This issue is being closed because it has not been updated in 3 months.

We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate.

jkotalik pushed a commit that referenced this issue Nov 1, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants