The type or namespace name 'HttpGet' could not be found when add 'System.Web.Http' namespace

后端 未结 4 1413
灰色年华
灰色年华 2021-02-04 01:28

I have one issue in MVC .

Currently I am working in MVC and the version is MVC4 . And I have 2 ActionResult Method, see below

[HttpGet]
 public ActionRe         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 01:57

    I ran into this problem on OS X using .NET Core. I was missing an entry for Microsoft.AspNetCore.Mvc in my project.json.

    Before:

    {
        "dependencies": {
            "Microsoft.NETCore.App": {
              "version": "1.0.0",
              "type": "platform"
            },
            ...,
            "Microsoft.Extensions.Configuration.CommandLine": "1.0.0"
          },
    ...
    }
    

    After:

    {
        "dependencies": {
            "Microsoft.NETCore.App": {
              "version": "1.0.0",
              "type": "platform"
            },
            ...,
            "Microsoft.AspNetCore.Mvc": "1.0.0",
            "Microsoft.Extensions.Configuration.CommandLine": "1.0.0"
          },
    ...
    }
    

提交回复
热议问题