I've created a web project using the above mentioned template. But I'm unable to add System.Web.Mvc dll. It's not found in the Add Reference dialog box of VS2015. It's needed for using [JsonRequestBehavior][1]. Are there any workarounds for using JsonRequestBehavior in such a project? I've Json.NET (aka Newtonsoft.json) NuGet package already installed.
-
Could it be a versioning issue? What system.web.mvc version did you install in nuget?gilmishal– gilmishal2016-07-26 22:39:07 +00:00Commented Jul 26, 2016 at 22:39
-
Whatever classes you need to add, use packagesearch.azurewebsites.net and then modify your project.json file.Lex Li– Lex Li2016-07-26 23:35:44 +00:00Commented Jul 26, 2016 at 23:35
1 Answer
ASP.NET Core is a complete rewrite of the ASP.NET webstack to make it portable and run on multiple platforms like Linux and MacOS and run without IIS.
System.Web.* was very tightly coupled to IIS, so it was removed completely from ASP.NET Core.
This is a reason why it's not called ASP.NET 5 / ASP.NET 5 MVC 6 anymore, because it confuses people who believe it's a successor of MVC5 and instead it's now named ASP.NET Core 1.0.0 to put an emphasis that it's not compatible with previous MVC frameworks.
Second, you can't simply add references like you did before. ASP.NET Core works with packages from nuget or any other private or public nuget feeds.
3 Comments
Microsoft.AspNetCore.Mvc namespace in the controller class but that did not help. This user seems to have similar issueJson method that accepts any such parameter in on the controller class github.com/aspnet/Mvc/blob/dev/src/… so I suspect this feature wasn't ported to ASP.NET Core