{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/2902","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/2902/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/2902/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/2902/events","html_url":"https://github.com/dotnet/cli/issues/2902","id":153170118,"number":2902,"title":"Project.json's \"copyToOutput\" isn't transitive","user":{"login":"DavidObando","id":950290,"avatar_url":"https://avatars.githubusercontent.com/u/950290?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidObando","html_url":"https://github.com/DavidObando","followers_url":"https://api.github.com/users/DavidObando/followers","following_url":"https://api.github.com/users/DavidObando/following{/other_user}","gists_url":"https://api.github.com/users/DavidObando/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidObando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidObando/subscriptions","organizations_url":"https://api.github.com/users/DavidObando/orgs","repos_url":"https://api.github.com/users/DavidObando/repos","events_url":"https://api.github.com/users/DavidObando/events{/privacy}","received_events_url":"https://api.github.com/users/DavidObando/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/cli/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/dotnet/cli/labels/needs%20design","name":"needs design","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/cli/milestones/5","html_url":"https://github.com/dotnet/cli/milestones/1.0.0-rtm","labels_url":"https://api.github.com/repos/dotnet/cli/milestones/5/labels","id":1389772,"number":5,"title":"1.0.0-rtm","description":"2016 (https://github.com/aspnet/Home/wiki/Roadmap)","creator":{"login":"Petermarcu","id":8228359,"avatar_url":"https://avatars.githubusercontent.com/u/8228359?v=3","gravatar_id":"","url":"https://api.github.com/users/Petermarcu","html_url":"https://github.com/Petermarcu","followers_url":"https://api.github.com/users/Petermarcu/followers","following_url":"https://api.github.com/users/Petermarcu/following{/other_user}","gists_url":"https://api.github.com/users/Petermarcu/gists{/gist_id}","starred_url":"https://api.github.com/users/Petermarcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Petermarcu/subscriptions","organizations_url":"https://api.github.com/users/Petermarcu/orgs","repos_url":"https://api.github.com/users/Petermarcu/repos","events_url":"https://api.github.com/users/Petermarcu/events{/privacy}","received_events_url":"https://api.github.com/users/Petermarcu/received_events","type":"User","site_admin":false},"open_issues":255,"closed_issues":261,"state":"open","created_at":"2015-11-02T19:50:04Z","updated_at":"2016-08-10T02:08:09Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2016-05-05T05:27:58Z","updated_at":"2016-08-11T06:44:00Z","closed_at":null,"body":"## Steps to reproduce\r\nHave `ProjectA` which defines a `\"copyToOutput\"` element within its `\"buildOptions\"` section in `project.json`. When compiled, the file or files in the `\"include\"` section will be copied to the output, along with `ProjectA.dll`.\r\n**ProjectA**\r\nproject.json _(\"include\": [\"ProgramA.cs\"] is just as an example)_\r\n```\r\n{\r\n  \"version\": \"1.0.0-*\",\r\n  \"buildOptions\": {\r\n    \"emitEntryPoint\": true,\r\n    \"copyToOutput\": {\r\n      \"include\": [\"ProgramA.cs\"]\r\n    }\r\n  },\r\n  \"dependencies\": {\r\n    \"Microsoft.NETCore.App\": {\r\n      \"type\": \"platform\",\r\n      \"version\": \"1.0.0-*\"\r\n    }\r\n  },\r\n  \"frameworks\": {\r\n    \"netcoreapp1.0\": {\r\n      \"imports\": \"dnxcore50\"\r\n    }\r\n  }\r\n}\r\n```\r\nProgramA.cs\r\n```C#\r\nusing System;\r\nnamespace ProjectA\r\n{\r\n    public class ClassFromProjectA\r\n    {\r\n        public int Value { get; set; } = 3;\r\n    }\r\n}\r\n```\r\n\r\nNow, have `ProjectB` which includes `ProjectA` as a reference. When compiled, it will produce `ProjectB.dll` as well as `ProjectA.dll` in the output directory.\r\n**ProjectB**\r\nproject.json\r\n```\r\n{\r\n  \"version\": \"1.0.0-*\",\r\n  \"buildOptions\": {\r\n    \"emitEntryPoint\": true\r\n  },\r\n  \"dependencies\": {\r\n    \"ProjectA\": \"1.0.0-*\",\r\n    \"Microsoft.NETCore.App\": {\r\n      \"type\": \"platform\",\r\n      \"version\": \"1.0.0-*\"\r\n    }\r\n  },\r\n  \"frameworks\": {\r\n    \"netcoreapp1.0\": {\r\n      \"imports\": \"dnxcore50\"\r\n    }\r\n  }\r\n}\r\n```\r\nProgramB.cs\r\n```C#\r\nusing System;\r\nusing ProjectA;\r\nnamespace ProjectB\r\n{\r\n    public class ProgramB\r\n    {\r\n        public static void Main(string[] args)\r\n        {\r\n            var r = new ClassFromProjectA();\r\n            Console.WriteLine($\"Value from ProjectA {r.Value}\");\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n## Expected  behavior\r\nThe files specified by the `\"copyToOutput\"` element of `ProjectA` show up in the output directory of `ProjectB`. Furthermore, I expect that the output directory for `ProjectA` also contains the files.\r\n\r\n## Actual behavior\r\nThe files included by the `\"copyToOutput\"` element of `ProjectA` will not be copied to the output of `ProjectB`, or the output directory of `ProjectA`. The files will only be copied to the output when the root compilation project is the one specifying the `\"copyToOutput\"` element, and it will only work on the files included by the root compilation project.\r\n\r\n## Environment data\r\n`dotnet --info` output:\r\n.NET Command Line Tools (1.0.0-rc2-002659)\r\n\r\nProduct Information:\r\n Version:     1.0.0-rc2-002659\r\n Commit Sha:  11a001706f\r\n\r\nRuntime Environment:\r\n OS Name:     Windows\r\n OS Version:  10.0.14295\r\n OS Platform: Windows\r\n RID:         win10-x64\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/cli/issues/comments/239084828","html_url":"https://github.com/dotnet/cli/issues/2902#issuecomment-239084828","issue_url":"https://api.github.com/repos/dotnet/cli/issues/2902","id":239084828,"user":{"login":"masaeedu","id":3674056,"avatar_url":"https://avatars.githubusercontent.com/u/3674056?v=3","gravatar_id":"","url":"https://api.github.com/users/masaeedu","html_url":"https://github.com/masaeedu","followers_url":"https://api.github.com/users/masaeedu/followers","following_url":"https://api.github.com/users/masaeedu/following{/other_user}","gists_url":"https://api.github.com/users/masaeedu/gists{/gist_id}","starred_url":"https://api.github.com/users/masaeedu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masaeedu/subscriptions","organizations_url":"https://api.github.com/users/masaeedu/orgs","repos_url":"https://api.github.com/users/masaeedu/repos","events_url":"https://api.github.com/users/masaeedu/events{/privacy}","received_events_url":"https://api.github.com/users/masaeedu/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T06:44:00Z","updated_at":"2016-08-11T06:44:00Z","body":"@Joshscorp I think this might not be fixed since project.json will be superseded by a return to msbuild. See the section on `msbuild-mitigated` issues in the README. FWIW, my workaround is to add the static files I need as resources (see [buildOptions.embed](http://stackoverflow.com/questions/34482073/how-do-i-make-an-xml-file-an-embedded-resource-in-a-vnext-asp-net-5-class-libr)), then add a static constructor in my library project that simply reads the resource streams and spits out the files into the executing assembly directory. This behaves identically to a properly functioning transitive `copyToOutput`, at least for my use case."}}
{"actor":{"display_login":"masaeedu"}}