Microsoft ASP.NET Web API 2 on .net 4.0

前端 未结 2 1382
暗喜
暗喜 2020-12-25 11:24

Is it possible to use ASP.NET Web API 2 with .net 4.0? I tried to upgrade from an older version but I get:

Could not install package \'Microsoft.AspNe

相关标签:
2条回答
  • 2020-12-25 12:06

    To answer my own question:

    No, it is NOT possible to use Web API 2 with .net 4.0:

    enter image description here

    This is taken from a slide by Damian Edwards. You can find additinal info here.

    0 讨论(0)
  • 2020-12-25 12:19

    FWIW, I had a .NET 4.0 requirement on the client (die WinXP!), but I could do .NET 4.5 on the server. So, I have WebApi2 running server side, but the WebApi1 client package running on the client, handling serialization, etc.

    Using the Package Manager Console in Visual Studio and choosing my client project in the default project dropdown, I was able to:

    Install-Package Microsoft.AspNet.WebApi.Client -Version 4.0.30506.0
    

    Everything thereafter worked well.

    0 讨论(0)
提交回复
热议问题