{"action":"created","issue":{"url":"https://api.github.com/repos/NuGet/Home/issues/2897","repository_url":"https://api.github.com/repos/NuGet/Home","labels_url":"https://api.github.com/repos/NuGet/Home/issues/2897/labels{/name}","comments_url":"https://api.github.com/repos/NuGet/Home/issues/2897/comments","events_url":"https://api.github.com/repos/NuGet/Home/issues/2897/events","html_url":"https://github.com/NuGet/Home/issues/2897","id":158379420,"number":2897,"title":"Excluding specific referenced projects when using IncludeReferencedProjects","user":{"login":"daveaglick","id":1020407,"avatar_url":"https://avatars.githubusercontent.com/u/1020407?v=3","gravatar_id":"","url":"https://api.github.com/users/daveaglick","html_url":"https://github.com/daveaglick","followers_url":"https://api.github.com/users/daveaglick/followers","following_url":"https://api.github.com/users/daveaglick/following{/other_user}","gists_url":"https://api.github.com/users/daveaglick/gists{/gist_id}","starred_url":"https://api.github.com/users/daveaglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveaglick/subscriptions","organizations_url":"https://api.github.com/users/daveaglick/orgs","repos_url":"https://api.github.com/users/daveaglick/repos","events_url":"https://api.github.com/users/daveaglick/events{/privacy}","received_events_url":"https://api.github.com/users/daveaglick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-03T14:26:14Z","updated_at":"2016-07-14T12:53:49Z","closed_at":null,"body":"Assume I have a solution that looks like:\r\n```\r\nSolution\r\n  Project A\r\n    References Project B\r\n    References Project C\r\n  Project B\r\n  Project C\r\n```\r\n\r\nIf I'm packing `Project A`, I can currently include a NuGet reference to `Project B` and `Project C` in one of two ways:\r\n* I can add the dependencies explicitly in the nuspec. This isn't very good because if I add `Project D` to the solution later and add a reference to it in `Project A` I'll have to remember to update the nuspec as well. There's also the issue of keeping versions matched up, etc.\r\n* I can use the `-IncludeReferencedProjects` flag, which works great in this scenario.\r\n\r\nNow let's assume that `Project C` is a development dependency. If `Project C` wasn't in my solution and I had added the reference via NuGet, I could use the `developmentDependency` flag in the `packages.config` to exclude it from the list of dependencies for `Project A`. I can also add the `developmentDependency` flag to the nuspec for `Project C` to ensure that any external projects that reference it don't include it in their list of dependencies.\r\n\r\n*However*, it doesn't seem like there's a way to address a development dependency if it's project reference and you want to continue to add *other* project references as dependencies. I would expect/propose a couple things:\r\n* If using `-IncludeReferencedProjects` and a referenced project has `developmentDependency` declared in its nuspec, that referenced project should not be among the list of dependencies in the package. This would match the behavior if you referenced the project via NuGet and packages.config (instead of being a project reference).\r\n* There should be some alternate way to exclude specific project references. Perhaps a `developmentDependency` flag in the csproj for the referenced project.\r\n\r\nThis isn't just a hypothetical situation - I'm having this exact problem right now. My `Project C` is a \"abstractions\" library that will already be loaded wherever the `Project A` library is used. Having it be a dependency of `Project A` means a chance of runtime versioning/binding issues."},"comment":{"url":"https://api.github.com/repos/NuGet/Home/issues/comments/232656921","html_url":"https://github.com/NuGet/Home/issues/2897#issuecomment-232656921","issue_url":"https://api.github.com/repos/NuGet/Home/issues/2897","id":232656921,"user":{"login":"JasonLawrenceDuncan","id":10030694,"avatar_url":"https://avatars.githubusercontent.com/u/10030694?v=3","gravatar_id":"","url":"https://api.github.com/users/JasonLawrenceDuncan","html_url":"https://github.com/JasonLawrenceDuncan","followers_url":"https://api.github.com/users/JasonLawrenceDuncan/followers","following_url":"https://api.github.com/users/JasonLawrenceDuncan/following{/other_user}","gists_url":"https://api.github.com/users/JasonLawrenceDuncan/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonLawrenceDuncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonLawrenceDuncan/subscriptions","organizations_url":"https://api.github.com/users/JasonLawrenceDuncan/orgs","repos_url":"https://api.github.com/users/JasonLawrenceDuncan/repos","events_url":"https://api.github.com/users/JasonLawrenceDuncan/events{/privacy}","received_events_url":"https://api.github.com/users/JasonLawrenceDuncan/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T12:53:49Z","updated_at":"2016-07-14T12:53:49Z","body":"FWIW, we have the same problem, and would be delighted to have a better solution. What we settled on (for now), is not using the IncludeReferencedProjects flag in our build script, and having to manually maintain any such dependencies."}}
{"actor":{"display_login":"JasonLawrenceDuncan"}}