{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/2380","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/2380/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/2380/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/2380/events","html_url":"https://github.com/aspnet/Mvc/issues/2380","id":68448623,"number":2380,"title":"Breaking changes list and migration guidance are needed","user":{"login":"evil-shrike","id":1203230,"avatar_url":"https://avatars.githubusercontent.com/u/1203230?v=3","gravatar_id":"","url":"https://api.github.com/users/evil-shrike","html_url":"https://github.com/evil-shrike","followers_url":"https://api.github.com/users/evil-shrike/followers","following_url":"https://api.github.com/users/evil-shrike/following{/other_user}","gists_url":"https://api.github.com/users/evil-shrike/gists{/gist_id}","starred_url":"https://api.github.com/users/evil-shrike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evil-shrike/subscriptions","organizations_url":"https://api.github.com/users/evil-shrike/orgs","repos_url":"https://api.github.com/users/evil-shrike/repos","events_url":"https://api.github.com/users/evil-shrike/events{/privacy}","received_events_url":"https://api.github.com/users/evil-shrike/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-14T17:24:37Z","updated_at":"2015-04-14T17:46:24Z","closed_at":"2015-04-14T17:46:24Z","body":"It is commonly claimed that MVC 6 is \"almost the same as MVC 5\". I read and heard this in many videos on AspNet5\\Mvc6. But the more I dive into it the more different it seems. Similar but different.\r\nConverting an Mvc5\\WebApi2 app onto AspNet5\\Mvc6 is a pain. \r\nThere're some guidances on the Internet how cool creating Mvc6 apps is. But I found nothing about how to migrate existing code onto Mvc6 (and AspNet5 in general). \r\nThe things are even worse due to terrible branding - \"ASP.NET 5 MVC 6\" (considering we have \"MVC 5\" already). Just google for \"Migrating onto ASP.NET 5 MVC 6\".\r\n\r\nSo it's highly desirable to provide some list of breaking changes. \r\nIt should consist of two parts at least: Api compatibility and UseCases compatibility.\r\nLet me clarify. \r\nApi compatibility is a list of changes in types, methods and so on.\r\nUseCases compatibility is a list of common use-cases in developing apps which are changed. For example:\r\n* register a startup hook \r\n  * before: via assembly-level attribute `WebActivator.PreApplicationStartMethod`\r\n  * now: `Startup` class\r\n* configuring Mvc\\WebApi components\r\n  * before: all components were in `HttpConfiguration` (Filters, Formatters, MessageHandlers, Services)\r\n  * now: setup `MvcOptions` object in callback  passed to `IServiceCollection.Configure<MvcOptions>()`\r\n* configuring Json formatter\r\n  * before: via `HttpConfiguration.Formatters.JsonFormatter.SerializerSettings`\r\n  * now: find `JsonInputFormatter` in `MvcOptions.InputFormatters` or `JsonOutputFormatter` in `MvcOptions.OutputFormatters` (there're two formatters now - input and output)\r\n* passing objects with `HttRequestMessage`\r\n  * before: it was common to put arbitrary objects into `HttRequestMessage.Properties` (usually with extension-methods like `request.SetUserRights()` where SetUserRights just put an object into request.Properties[HttpPropertyKey.UserRights] ).\r\n  * now: WHAT?\r\n* IoC\\DI\r\n  * before: register `IDependencyResolver` implementations (there were two ones: in `System.Web.Http` and in  `System.Web.Mvc`) in HttpConfiguration.Services\r\n  * now: there're two options: remove usage of your 3rd-party DI completely (as AspNet5 now provides a DI-container by default) or provider a custom implementation of `IServiceProvider` to `IApplicationBuilder.ApplicationServices` in `Startup.Configure`)\r\n* BrowserCapabilities - understand what browser is being used \r\n  * before: using `HttpBrowserCapabilitiesBase` instance from `Request.Browser`\r\n  * now: WHAT?\r\n* Api controller working with raw Http-types\r\n  * before: create an ApiController's method with a arg of `HttpRequstMessage` and return type of `HttpResponseMessage`. To create response: `Request.CreateResponse`. Easy.\r\n  * now: WHAT?\r\n* Api controller returns a fine-tuned http-response (for cache controlling)\r\n  * before: create a `HttpRequestMessage` and assign Headers (typed!):\r\n```\r\nvar response = Request.CreateResponse(HttpStatusCode.OK);\r\nresponse.Content = new StringContent(content);\r\nresponse.Content.Headers.ContentType = new MediaTypeHeaderValue(\"text/cache-manifest\");\r\nresponse.Headers.CacheControl = new CacheControlHeaderValue {NoCache = true, Public = true};\r\nresponse.Headers.ETag = new EntityTagHeaderValue(\"\\\"\" + etag + \"\\\"\");\r\n```\r\n* \r\n  * now: WHAT? \r\n* Api controller returns a non-OK response with payload\r\n  * before: `return Request.CreateResponse(statusCode, someObj)`\r\n  * now: WHAT? I can create `new HttpStatusCodeResult((int)statusCode)` but how to pass the payload?\r\n* ValueProvider (applicable?)\r\n* content negotiation (applicable?)\r\n\r\nand so on..\r\n\r\nI personally encountered with the following \"surprises\" - disappearing of types/methods/properties \r\n* Mvc: disappeared type WebViewPage\r\n* Mvc: disappeared type HttpRequestBase\r\n* Mvc: disappeared type HttpCookieCollection\r\n* WebApi: disappeared type DelegatingHandler\r\n* WebApi: typed access to HttpRequestMessage.Headers (like request.Headers.AcceptLanguage)\r\n* disappeared property HttpRequest.Properties\r\n* disappeared method HttpRequest.CreateResponse\r\n* Razor: disappeared `@RenderPage`\r\n* AspNet: disappeared type HttpBrowserCapabilitiesBase (it's type of `Request.Browser` property)\r\n* AspNet: why does HttpStatusCodeResult not use HttpStatusCode enum?\r\n* What happened with System.Net.Http ? Can I use types from it (like FormDataCollection) in AspNet5 apps? \r\n* WebApi: disappeared types ValueProvider\\RouteDataValueProviderFactory\r\n* WebApi: Request.CreateResponse(statusCode, someObj)\r\n"}}