aspnet / AspNetWebStack

ASP.NET MVC 5.x, Web API 2.x, and Web Pages 3.x (not ASP.NET Core)
Other
858 stars 354 forks source link

Microsoft.AspNet.WebApi.Core (5.2.6) is not compatible with .NET Core 2.1 #179

Closed Eilon closed 6 years ago

Eilon commented 6 years ago

From @NN--- on July 12, 2018 11:5

After installing nuget Microsoft.AspNet.WebApi.Core I get the following message:

Package 'Microsoft.AspNet.WebApi.Core 5.2.6' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

Copied from original issue: aspnet/Home#3319

Eilon commented 6 years ago

From @blowdart on July 12, 2018 12:19

Ah, wrong package, but I can see why you're confused.

Packages targeting asp.net core being with Microsoft.AspNetCore. What you're adding is a package for previous versions of WebApi, and whilst it has Core in its name it's not for the Core platform.

There's no specific WebApi package for ASP.NET Core any more, it's all built into MVC and the .App or .All package.

dougbu commented 6 years ago

@Eilon I don't see any action to take here. What are you recommending?

@NN--- the only aspnet/AspNetWebStack package containing ASP.NET Core-compatible assemblies is Microsoft.AspNet.WebApi.Client.

Eilon commented 6 years ago

@dougbu I didn't file the original bug. I haven't looked into this issue at all.

dougbu commented 6 years ago

@NN--- thank you for your feedback. We're closing this issue as the questions asked here have been answered.

As @blowdart said, Microsoft.AspNet.WebApi.Core is not part of ASP.NET Core (Microsoft.AspNetCore.* packages). And, as I said, this repo does produce one compatible package -- Microsoft.AspNet.WebApi.Client. (But, that one package doesn't seem to be what you're looking for.)

For ASP.NET Core, please see https://github.com/aspnet/Home or, for documentation, https://docs.microsoft.com/en-us/aspnet/index

duongphuhiep commented 6 years ago

so basicly, no need to install Microsoft.AspNet.WebApi.Cors package anymore, we should just remove it from project dependencies to get rid of the warning... thanks

sapatelbaps commented 5 years ago

I am new to ASP .NET Core and searching to fix this error since two days. Would you please help me what is the work around or how can I fix it - by removing project dependencies? Thnx

NN--- commented 5 years ago

@sapatelbaps How exactly you created your project ? If you just use wizards there will be no issue. As It was mentioned you don't need this package, You need packages starting with "Microsoft.AspNetCore"

sapatelbaps commented 5 years ago

@NN--- I just created ASP .NET Core web project from Visual Studio 2019 RC Community Edition. Immediately after creating the project I got this error and looking for solutions but nothing worked out so far! I didn't even open any file of the project just immediately after creating project I got this errors!

sapatelbaps commented 5 years ago

Actually, clearing nuget cache from Visual Studio options fixed the issue and now I can build and run the project.

AraHaan commented 4 years ago

interesting I got this same issue now; only difference is it is for version 5.2.7 not compatible with netcoreapp3.1.

@dougbu

saadahmed42 commented 3 years ago

Hi - can anyone please tell me what version of Microsoft.AspNet.WebApi.Core is compatible with netcoreapp3.1 . Also, is there a way to find out this info for any nuget package.

Eilon commented 3 years ago

@saadahmed42 I don't think any of them are compatible with netcoreapp3.1 because they are designed to run on .NET Framework and System.Web. For .NET Core 3.1 you need to use ASP.NET Core 3.1: https://docs.microsoft.com/aspnet/core/web-api/?view=aspnetcore-3.1

dougbu commented 3 years ago

Agreed @Eilon.

The only aspnet/AspNetWebStack package containing ASP.NET Core-compatible assemblies is Microsoft.AspNet.WebApi.Client.