{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Docs/issues/2943","repository_url":"https://api.github.com/repos/aspnet/Docs","labels_url":"https://api.github.com/repos/aspnet/Docs/issues/2943/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Docs/issues/2943/comments","events_url":"https://api.github.com/repos/aspnet/Docs/issues/2943/events","html_url":"https://github.com/aspnet/Docs/issues/2943","id":213404503,"number":2943,"title":"Localization sample doesn't work if an application is deployed in IIS as Virtual App","user":{"login":"PeterJakubik","id":8522400,"avatar_url":"https://avatars1.githubusercontent.com/u/8522400?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterJakubik","html_url":"https://github.com/PeterJakubik","followers_url":"https://api.github.com/users/PeterJakubik/followers","following_url":"https://api.github.com/users/PeterJakubik/following{/other_user}","gists_url":"https://api.github.com/users/PeterJakubik/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterJakubik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterJakubik/subscriptions","organizations_url":"https://api.github.com/users/PeterJakubik/orgs","repos_url":"https://api.github.com/users/PeterJakubik/repos","events_url":"https://api.github.com/users/PeterJakubik/events{/privacy}","received_events_url":"https://api.github.com/users/PeterJakubik/received_events","type":"User","site_admin":false},"labels":[{"id":159095404,"url":"https://api.github.com/repos/aspnet/Docs/labels/bug","name":"bug","color":"fc2929","default":true},{"id":327109981,"url":"https://api.github.com/repos/aspnet/Docs/labels/P1","name":"P1","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"Rick-Anderson","id":3605364,"avatar_url":"https://avatars2.githubusercontent.com/u/3605364?v=3","gravatar_id":"","url":"https://api.github.com/users/Rick-Anderson","html_url":"https://github.com/Rick-Anderson","followers_url":"https://api.github.com/users/Rick-Anderson/followers","following_url":"https://api.github.com/users/Rick-Anderson/following{/other_user}","gists_url":"https://api.github.com/users/Rick-Anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/Rick-Anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rick-Anderson/subscriptions","organizations_url":"https://api.github.com/users/Rick-Anderson/orgs","repos_url":"https://api.github.com/users/Rick-Anderson/repos","events_url":"https://api.github.com/users/Rick-Anderson/events{/privacy}","received_events_url":"https://api.github.com/users/Rick-Anderson/received_events","type":"User","site_admin":false},"assignees":[{"login":"Rick-Anderson","id":3605364,"avatar_url":"https://avatars2.githubusercontent.com/u/3605364?v=3","gravatar_id":"","url":"https://api.github.com/users/Rick-Anderson","html_url":"https://github.com/Rick-Anderson","followers_url":"https://api.github.com/users/Rick-Anderson/followers","following_url":"https://api.github.com/users/Rick-Anderson/following{/other_user}","gists_url":"https://api.github.com/users/Rick-Anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/Rick-Anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rick-Anderson/subscriptions","organizations_url":"https://api.github.com/users/Rick-Anderson/orgs","repos_url":"https://api.github.com/users/Rick-Anderson/repos","events_url":"https://api.github.com/users/Rick-Anderson/events{/privacy}","received_events_url":"https://api.github.com/users/Rick-Anderson/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/aspnet/Docs/milestones/4","html_url":"https://github.com/aspnet/Docs/milestone/4","labels_url":"https://api.github.com/repos/aspnet/Docs/milestones/4/labels","id":1356168,"number":4,"title":"Backlog","description":"Issues that have been triaged but aren’t yet scheduled. Issues not assigned to any milestone are those that have not been triaged.","creator":{"login":"danroth27","id":1874516,"avatar_url":"https://avatars1.githubusercontent.com/u/1874516?v=3","gravatar_id":"","url":"https://api.github.com/users/danroth27","html_url":"https://github.com/danroth27","followers_url":"https://api.github.com/users/danroth27/followers","following_url":"https://api.github.com/users/danroth27/following{/other_user}","gists_url":"https://api.github.com/users/danroth27/gists{/gist_id}","starred_url":"https://api.github.com/users/danroth27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danroth27/subscriptions","organizations_url":"https://api.github.com/users/danroth27/orgs","repos_url":"https://api.github.com/users/danroth27/repos","events_url":"https://api.github.com/users/danroth27/events{/privacy}","received_events_url":"https://api.github.com/users/danroth27/received_events","type":"User","site_admin":false},"open_issues":128,"closed_issues":20,"state":"open","created_at":"2015-10-14T20:43:26Z","updated_at":"2017-03-28T02:00:27Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-03-10T17:35:50Z","updated_at":"2017-03-28T18:50:48Z","closed_at":null,"body":"In https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization#resource-file-naming the sample in \"Setting the culture programmatically\" doesn't work if the ASP MVC app is deployed in IIS in Virtual Application\r\n\r\nWhen the App is IIS Virtual Application the returnUrl in form parameter is wrong.\r\n\r\nI think that sample should prepend the \"~\" like:\r\n```\r\n@{\r\nvar requestCulture = Context.Features.Get<IRequestCultureFeature>();\r\n  var cultureItems = LocOptions.Value.SupportedUICultures\r\n        .Select(c => new SelectListItem { Value = c.Name, Text = c.DisplayName })\r\n        .ToList();\r\n   var returnUrl = string.IsNullOrEmpty(Context.Request.Path) ? \"~/\" : \"~\" + Context.Request.Path.Value;\r\n}\r\n\r\n<div title=\"@Localizer[\"Request culture provider:\"] @requestCulture?.Provider?.GetType().Name\" style=\"text-align:center; padding:5px\">\r\n    <form id=\"selectLanguage\" asp-controller=\"Localizer\"\r\n          asp-action=\"SetLanguage\" asp-route-returnUrl=\"@returnUrl\"\r\n          method=\"post\" class=\"form-horizontal\" role=\"form\">\r\n        \r\n        <label style=\"color:white\">@Localizer[\"Language:\"]</label>      \r\n        <select name=\"culture\" onchange=\"this.form.submit();\"\r\n                asp-for=\"@requestCulture.RequestCulture.UICulture.Name\" asp-items=\"cultureItems\"></select>\r\n    </form>\r\n</div>\r\n```\r\n\r\nWith this fix the Controller works with `LocalRedirect(returnUrl)`\r\n\r\nKind regards\r\nPeter"},"comment":{"url":"https://api.github.com/repos/aspnet/Docs/issues/comments/289868184","html_url":"https://github.com/aspnet/Docs/issues/2943#issuecomment-289868184","issue_url":"https://api.github.com/repos/aspnet/Docs/issues/2943","id":289868184,"user":{"login":"Rick-Anderson","id":3605364,"avatar_url":"https://avatars2.githubusercontent.com/u/3605364?v=3","gravatar_id":"","url":"https://api.github.com/users/Rick-Anderson","html_url":"https://github.com/Rick-Anderson","followers_url":"https://api.github.com/users/Rick-Anderson/followers","following_url":"https://api.github.com/users/Rick-Anderson/following{/other_user}","gists_url":"https://api.github.com/users/Rick-Anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/Rick-Anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rick-Anderson/subscriptions","organizations_url":"https://api.github.com/users/Rick-Anderson/orgs","repos_url":"https://api.github.com/users/Rick-Anderson/repos","events_url":"https://api.github.com/users/Rick-Anderson/events{/privacy}","received_events_url":"https://api.github.com/users/Rick-Anderson/received_events","type":"User","site_admin":false},"created_at":"2017-03-28T18:50:48Z","updated_at":"2017-03-28T18:50:48Z","body":"@ryanbrandenburg please review"}}
{"actor":{"display_login":"Rick-Anderson"}}