0
votes

I have provide support for ApiController with the Microsoft.AspNetCore.Mvc.WebApiCompatShim(1.0.3) package in .Net core 1.0.

Currently, I upgrading the project to .Net core 2.0 from 1.0. At the same time, I upgraded the Microsoft.AspNetCore.Mvc.WebApiCompatShim package to 2.0.0 version.

The following changes are done in .csproj when migrating .Net core 2.0 from 1.0.

  • Changed the TargetFramework version.

enter image description here

  • Renaming the AssetTargetFallback from PackageTargetFallback.

enter image description here

But, I am getting the following warnings for Microsoft.AspNetCore.Mvc.WebApiCompatShim(2.0.0) when restoring.

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

How to solve this.

1

1 Answers

1
votes

Displaying this warning message, when restoring "compatibility" nuget packages is by design. When you get such a warning when restoring any compat shim, that would mean that your compat shim is working properly. You can suppress this warning by going to properties of that package and setting "NoWarn" property.

enter image description here

For a full discussion on this type of issue by Immo Landwerth please have a look here

Hope this helps.