{"action":"created","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":[{"id":411637266,"url":"https://api.github.com/repos/dotnet/cli/labels/msbuild-mitigated","name":"msbuild-mitigated","color":"4D7BA8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/cli/milestones/11","html_url":"https://github.com/dotnet/cli/milestones/1.0.0-preview3","labels_url":"https://api.github.com/repos/dotnet/cli/milestones/11/labels","id":1783772,"number":11,"title":"1.0.0-preview3","description":"","creator":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":108,"state":"open","created_at":"2016-05-23T22:32:41Z","updated_at":"2016-10-31T19:26:26Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-10-17T11:43:20Z","updated_at":"2016-10-31T20:43:02Z","closed_at":null,"body":"## Steps to reproduce\n\nCreate two projects with the following directory structure:\n- lib\n- exe\n\n```\n(mkdir lib && cd lib && dotnet new -t lib)\n(mkdir exe && cd exe && dotnet new -t console)\n```\n\nIn `lib/project.json`, add a name property:\n\n```\n{\n  \"name\" : \"Foo.Library\",\n  \"version\": \"1.0.0-*\",\n  \"buildOptions\": {\n    \"debugType\": \"portable\"\n  },\n  \"dependencies\": {},\n  \"frameworks\": {\n    \"netstandard1.6\": {\n      \"dependencies\": {\n        \"NETStandard.Library\": \"1.6.0\"\n      }\n    }\n  }\n}\n```\n\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):\n\n```\n{\n  \"version\": \"1.0.0-*\",\n  \"buildOptions\": {\n    \"debugType\": \"portable\",\n    \"emitEntryPoint\": true\n  },\n  \"dependencies\": {\n    \"lib\" : {\n      \"target\" : \"project\"\n    }\n  },\n  \"frameworks\": {\n    \"netcoreapp1.0\": {\n      \"dependencies\": {\n        \"Microsoft.NETCore.App\": {\n          \"type\": \"platform\",\n          \"version\": \"1.0.1\"\n        }\n      },\n      \"imports\": \"dnxcore50\"\n    }\n  }\n}\n```\n\nNow build and publish:\n\n```\n(cd lib && dotnet restore && dotnet build)\n(cd exe && dotnet restore && dotnet build && dotnet publish)\n```\n## Expected  behavior\n\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.\n## Actual behavior\n\n```\n$ (cd lib && dotnet restore && dotnet build)\nlog  : Restoring packages for /dotnet-cli-bug/lib/project.json...\nlog  : Lock file has not changed. Skipping lock file write. Path: /dotnet-cli-bug/lib/project.lock.json\nlog  : /dotnet-cli-bug/lib/project.json\nlog  : Restore completed in 242ms.\nProject Foo.Library (.NETStandard,Version=v1.6) will be compiled because expected outputs are missing\nCompiling Foo.Library for .NETStandard,Version=v1.6\n\nCompilation succeeded.\n    0 Warning(s)\n    0 Error(s)\n\nTime elapsed 00:00:00.8820399\n\n$ (cd exe && dotnet restore && dotnet build && dotnet publish)\nlog  : Restoring packages for /dotnet-cli-bug/exe/project.json...\nlog  : Lock file has not changed. Skipping lock file write. Path: /dotnet-cli-bug/exe/project.lock.json\nlog  : /dotnet-cli-bug/exe/project.json\nlog  : Restore completed in 600ms.\nProject exe (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing\nCompiling exe for .NETCoreApp,Version=v1.0\n\nCompilation succeeded.\n    0 Warning(s)\n    0 Error(s)\n\nTime elapsed 00:00:00.9907910\n\n\nPublishing exe for .NETCoreApp,Version=v1.0\nProject exe (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.\nThe given key was not present in the dictionary.\n```\n\nRemoving the name property from the library works, but then there is no control over the output assembly filename.\n## Environment data\n\n`dotnet --info` output:\n\n```\n.NET Command Line Tools (1.0.0-preview2-003131)\n\nProduct Information:\n Version:            1.0.0-preview2-003131\n Commit SHA-1 hash:  635cf40e58\n\nRuntime Environment:\n OS Name:     Mac OS X\n OS Version:  10.11\n OS Platform: Darwin\n RID:         osx.10.11-x64\n```\n"},"comment":{"url":"https://api.github.com/repos/dotnet/cli/issues/comments/257414821","html_url":"https://github.com/dotnet/cli/issues/4426#issuecomment-257414821","issue_url":"https://api.github.com/repos/dotnet/cli/issues/4426","id":257414821,"user":{"login":"blackdwarf","id":3115004,"avatar_url":"https://avatars.githubusercontent.com/u/3115004?v=3","gravatar_id":"","url":"https://api.github.com/users/blackdwarf","html_url":"https://github.com/blackdwarf","followers_url":"https://api.github.com/users/blackdwarf/followers","following_url":"https://api.github.com/users/blackdwarf/following{/other_user}","gists_url":"https://api.github.com/users/blackdwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/blackdwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackdwarf/subscriptions","organizations_url":"https://api.github.com/users/blackdwarf/orgs","repos_url":"https://api.github.com/users/blackdwarf/repos","events_url":"https://api.github.com/users/blackdwarf/events{/privacy}","received_events_url":"https://api.github.com/users/blackdwarf/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T20:43:02Z","updated_at":"2016-10-31T20:43:02Z","body":"With MSBuild, there is no concept if referencing other projects via a name. The `<ProjectReference>` element's `Include` property must be a path. Therefore, this issue is not valid in the MSBuild based CLI. \r\n\r\nUsing the same setup as was outlined in the original issue, I've run `dotnet migrate` and was able to successfully restore and then publish the console application. Of course, upon migrating, the `exe` project's reference was a relative path to the `lib` project. "}}
{"actor":{"display_login":"blackdwarf"}}