{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Localization/issues/222","repository_url":"https://api.github.com/repos/aspnet/Localization","labels_url":"https://api.github.com/repos/aspnet/Localization/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Localization/issues/222/comments","events_url":"https://api.github.com/repos/aspnet/Localization/issues/222/events","html_url":"https://github.com/aspnet/Localization/issues/222","id":137852482,"number":222,"title":"AddViewLocalization without parameters not working after latest changes in aspnet/Localization","user":{"login":"mmalolepszy","id":9466870,"avatar_url":"https://avatars.githubusercontent.com/u/9466870?v=3","gravatar_id":"","url":"https://api.github.com/users/mmalolepszy","html_url":"https://github.com/mmalolepszy","followers_url":"https://api.github.com/users/mmalolepszy/followers","following_url":"https://api.github.com/users/mmalolepszy/following{/other_user}","gists_url":"https://api.github.com/users/mmalolepszy/gists{/gist_id}","starred_url":"https://api.github.com/users/mmalolepszy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmalolepszy/subscriptions","organizations_url":"https://api.github.com/users/mmalolepszy/orgs","repos_url":"https://api.github.com/users/mmalolepszy/repos","events_url":"https://api.github.com/users/mmalolepszy/events{/privacy}","received_events_url":"https://api.github.com/users/mmalolepszy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-02T11:48:16Z","updated_at":"2016-03-02T11:49:53Z","closed_at":"2016-03-02T11:49:53Z","body":"Calling AddViewLocalization extension method without parameters in Startup class, causes an exception:\r\n```\r\nApplication startup exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.\r\nParameter name: setupAction\r\n   at Microsoft.Extensions.DependencyInjection.LocalizationServiceCollectionExtensions.AddLocalization(IServiceCollection services, Action`1 setupAction)\r\n   at Microsoft.Extensions.DependencyInjection.MvcLocalizationMvcBuilderExtensions.AddViewLocalization(IMvcBuilder builder, LanguageViewLocationExpanderFormat format, Action`1 setupAction)\r\n   at Microsoft.Extensions.DependencyInjection.MvcLocalizationMvcBuilderExtensions.AddViewLocalization(IMvcBuilder builder, LanguageViewLocationExpanderFormat format)\r\n   at MyApp.Startup.ConfigureServices(IServiceCollection services) in C:\\Projects\\EDU\\MyApp\\src\\MyApp\\Startup.cs:line 67\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at Microsoft.AspNetCore.Hosting.Startup.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection exportServices)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n```\r\nSnippet from my Startup.cs\r\n```\r\npublic void ConfigureServices(IServiceCollection services)\r\n{\r\n    // (...)\r\n\r\n    // Add MVC services to the services container\r\n    services.AddMvc()\r\n        .AddViewLocalization()\r\n        .AddDataAnnotationsLocalization();\r\n\r\n    // (...)\r\n}\r\n```\r\nChanging above code to \r\n```\r\npublic void ConfigureServices(IServiceCollection services)\r\n{\r\n    // (...)\r\n\r\n    // Add MVC services to the services container\r\n    services.AddMvc()\r\n        .AddViewLocalization(o => o.ResourcesPath = \"/path/to/my/resources\")\r\n        .AddDataAnnotationsLocalization();\r\n\r\n    // (...)\r\n}\r\n```\r\nmakes everything work as expected.\r\n\r\nThis problem is caused by setting `setupAction` to `null` [here](https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Localization/DependencyInjection/MvcLocalizationMvcBuilderExtensions.cs#L46) and it started to appear after this [change](https://github.com/aspnet/Localization/pull/217) in aspnet/Localization repository. \r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Localization/issues/comments/191206103","html_url":"https://github.com/aspnet/Localization/issues/222#issuecomment-191206103","issue_url":"https://api.github.com/repos/aspnet/Localization/issues/222","id":191206103,"user":{"login":"mmalolepszy","id":9466870,"avatar_url":"https://avatars.githubusercontent.com/u/9466870?v=3","gravatar_id":"","url":"https://api.github.com/users/mmalolepszy","html_url":"https://github.com/mmalolepszy","followers_url":"https://api.github.com/users/mmalolepszy/followers","following_url":"https://api.github.com/users/mmalolepszy/following{/other_user}","gists_url":"https://api.github.com/users/mmalolepszy/gists{/gist_id}","starred_url":"https://api.github.com/users/mmalolepszy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmalolepszy/subscriptions","organizations_url":"https://api.github.com/users/mmalolepszy/orgs","repos_url":"https://api.github.com/users/mmalolepszy/repos","events_url":"https://api.github.com/users/mmalolepszy/events{/privacy}","received_events_url":"https://api.github.com/users/mmalolepszy/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T11:49:53Z","updated_at":"2016-03-02T11:49:53Z","body":"Oh my, I wanted to post it in aspnet/Mvc."}}