3

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.

2
  • Could it be a versioning issue? What system.web.mvc version did you install in nuget? Commented Jul 26, 2016 at 22:39
  • Whatever classes you need to add, use packagesearch.azurewebsites.net and then modify your project.json file. Commented Jul 26, 2016 at 23:35

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

You might also point out the new documentation site at docs.asp.net
So how do I use JsonRequestBehavior in an ASP.NET Core (.NET Framework) project template. As I mentioned above, I've already installed Json.NET package through NuGet and I'm using Microsoft.AspNetCore.Mvc namespace in the controller class but that did not help. This user seems to have similar issue
There is no overload of Json 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.