{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/4426","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/4426/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/4426/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/4426/events","html_url":"https://github.com/dotnet/cli/issues/4426","id":183393929,"number":4426,"title":"Non-default named library appears to cause \"The given key was not present in the dictionary\" when using `dotnet publish`","user":{"login":"flaub","id":111859,"avatar_url":"https://avatars.githubusercontent.com/u/111859?v=3","gravatar_id":"","url":"https://api.github.com/users/flaub","html_url":"https://github.com/flaub","followers_url":"https://api.github.com/users/flaub/followers","following_url":"https://api.github.com/users/flaub/following{/other_user}","gists_url":"https://api.github.com/users/flaub/gists{/gist_id}","starred_url":"https://api.github.com/users/flaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flaub/subscriptions","organizations_url":"https://api.github.com/users/flaub/orgs","repos_url":"https://api.github.com/users/flaub/repos","events_url":"https://api.github.com/users/flaub/events{/privacy}","received_events_url":"https://api.github.com/users/flaub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-17T11:43:20Z","updated_at":"2016-10-17T11:43:20Z","closed_at":null,"body":"## Steps to reproduce\r\nCreate two projects with the following directory structure:\r\n- lib\r\n- exe\r\n\r\n```\r\n(mkdir lib && cd lib && dotnet new -t lib)\r\n(mkdir exe && cd exe && dotnet new -t console)\r\n```\r\n\r\nIn `lib/project.json`, add a name property:\r\n```\r\n{\r\n  \"name\" : \"Foo.Library\",\r\n  \"version\": \"1.0.0-*\",\r\n  \"buildOptions\": {\r\n    \"debugType\": \"portable\"\r\n  },\r\n  \"dependencies\": {},\r\n  \"frameworks\": {\r\n    \"netstandard1.6\": {\r\n      \"dependencies\": {\r\n        \"NETStandard.Library\": \"1.6.0\"\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nIn `exe/project.json`, add `Foo.Library` as a dependency (note that \"lib\" must be used instead of the intuitive \"Foo.Library\" for the key of the dependency):\r\n```\r\n{\r\n  \"version\": \"1.0.0-*\",\r\n  \"buildOptions\": {\r\n    \"debugType\": \"portable\",\r\n    \"emitEntryPoint\": true\r\n  },\r\n  \"dependencies\": {\r\n    \"lib\" : {\r\n      \"target\" : \"project\"\r\n    }\r\n  },\r\n  \"frameworks\": {\r\n    \"netcoreapp1.0\": {\r\n      \"dependencies\": {\r\n        \"Microsoft.NETCore.App\": {\r\n          \"type\": \"platform\",\r\n          \"version\": \"1.0.1\"\r\n        }\r\n      },\r\n      \"imports\": \"dnxcore50\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nNow build and publish:\r\n```\r\n(cd lib && dotnet restore && dotnet build)\r\n(cd exe && dotnet restore && dotnet build && dotnet publish)\r\n```\r\n\r\n## Expected  behavior\r\nThe final dotnet publish command should complete successfully. Additionally, project dependencies should be allowed to be specified by their name specified in the project.json, rather than the directory name.\r\n\r\n## Actual behavior\r\n```\r\n$ (cd lib && dotnet restore && dotnet build)\r\nlog  : Restoring packages for /dotnet-cli-bug/lib/project.json...\r\nlog  : Lock file has not changed. Skipping lock file write. Path: /dotnet-cli-bug/lib/project.lock.json\r\nlog  : /dotnet-cli-bug/lib/project.json\r\nlog  : Restore completed in 242ms.\r\nProject Foo.Library (.NETStandard,Version=v1.6) will be compiled because expected outputs are missing\r\nCompiling Foo.Library for .NETStandard,Version=v1.6\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:00.8820399\r\n\r\n$ (cd exe && dotnet restore && dotnet build && dotnet publish)\r\nlog  : Restoring packages for /dotnet-cli-bug/exe/project.json...\r\nlog  : Lock file has not changed. Skipping lock file write. Path: /dotnet-cli-bug/exe/project.lock.json\r\nlog  : /dotnet-cli-bug/exe/project.json\r\nlog  : Restore completed in 600ms.\r\nProject exe (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing\r\nCompiling exe for .NETCoreApp,Version=v1.0\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:00.9907910\r\n\r\n\r\nPublishing exe for .NETCoreApp,Version=v1.0\r\nProject exe (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.\r\nThe given key was not present in the dictionary.\r\n```\r\n\r\nRemoving the name property from the library works, but then there is no control over the output assembly filename.\r\n\r\n## Environment data\r\n`dotnet --info` output:\r\n```\r\n.NET Command Line Tools (1.0.0-preview2-003131)\r\n\r\nProduct Information:\r\n Version:            1.0.0-preview2-003131\r\n Commit SHA-1 hash:  635cf40e58\r\n\r\nRuntime Environment:\r\n OS Name:     Mac OS X\r\n OS Version:  10.11\r\n OS Platform: Darwin\r\n RID:         osx.10.11-x64\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"flaub"}}