{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/UserSecrets/issues/62","repository_url":"https://api.github.com/repos/aspnet/UserSecrets","labels_url":"https://api.github.com/repos/aspnet/UserSecrets/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/UserSecrets/issues/62/comments","events_url":"https://api.github.com/repos/aspnet/UserSecrets/issues/62/events","html_url":"https://github.com/aspnet/UserSecrets/issues/62","id":134089963,"number":62,"title":"Using user secrets with dotnet cli requires publishing the project.json file","user":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars.githubusercontent.com/u/1821173?v=3","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/UserSecrets/labels/0%20-%20Backlog","name":"0 - Backlog","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/UserSecrets/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/aspnet/UserSecrets/labels/needs%20design","name":"needs design","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/aspnet/UserSecrets/milestones/12","html_url":"https://github.com/aspnet/UserSecrets/milestones/1.0.1","labels_url":"https://api.github.com/repos/aspnet/UserSecrets/milestones/12/labels","id":1785330,"number":12,"title":"1.0.1","description":null,"creator":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":0,"state":"open","created_at":"2016-05-24T16:45:27Z","updated_at":"2016-05-27T21:10:03Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2016-02-16T20:34:58Z","updated_at":"2016-05-31T06:48:50Z","closed_at":null,"body":"It needs to read `userSecretsId` from the project.json. We should find a different way to publish this value.\r\n\r\n```\r\nC:\\git\\Universe\\Security\\samples\\SocialSample\\bin\\Debug\\dnx451>SocialSample.exe\r\nApplication startup exception: System.InvalidOperationException: Unable to locate a project.json at 'C:\\git\\Universe\\\r\nSecurity\\samples\\SocialSample\\bin\\Debug\\dnx451\\project.json'.\r\n   at Microsoft.Extensions.Configuration.UserSecrets.PathHelper.GetSecretsPath(String projectPath)\r\n   at Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration)\r\n   at SocialSample.Startup..ctor() in C:\\git\\Universe\\Security\\samples\\SocialSample\\Startup.cs:line 35\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider\r\nprovider)\r\n   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetServiceOrCreateInstance(IServiceProvider provide\r\nr, Type type)\r\n   at Microsoft.AspNetCore.Hosting.Startup.StartupLoader.LoadMethods(Type startupType, IList`1 diagnosticMessages)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureStartup()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/UserSecrets/issues/comments/222605703","html_url":"https://github.com/aspnet/UserSecrets/issues/62#issuecomment-222605703","issue_url":"https://api.github.com/repos/aspnet/UserSecrets/issues/62","id":222605703,"user":{"login":"Zoltu","id":886059,"avatar_url":"https://avatars.githubusercontent.com/u/886059?v=3","gravatar_id":"","url":"https://api.github.com/users/Zoltu","html_url":"https://github.com/Zoltu","followers_url":"https://api.github.com/users/Zoltu/followers","following_url":"https://api.github.com/users/Zoltu/following{/other_user}","gists_url":"https://api.github.com/users/Zoltu/gists{/gist_id}","starred_url":"https://api.github.com/users/Zoltu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zoltu/subscriptions","organizations_url":"https://api.github.com/users/Zoltu/orgs","repos_url":"https://api.github.com/users/Zoltu/repos","events_url":"https://api.github.com/users/Zoltu/events{/privacy}","received_events_url":"https://api.github.com/users/Zoltu/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T06:48:50Z","updated_at":"2016-05-31T06:48:50Z","body":"Workaround: Create the following extension method and use it instead of the built-in one:\r\n```\r\npublic static IConfigurationBuilder AddUserSecrets(this IConfigurationBuilder it, IHostingEnvironment hostingEnvironment) => hostingEnvironment.IsDevelopment() ? it.AddUserSecrets() : it;\r\n```\r\n\r\nThis doesn't solve the problem of running `Development` environment in something like staging, just allows you to have a slightly simplified configuration setup."}}
{"actor":{"display_login":"Zoltu"}}