简体   繁体   中英

NuGet package for ASP.NET Core 5 MVC

What NuGet package should I be using to access the Twilio API from my ASP.NET Core MVC 5.0 project?

My ASP.NET Core project file targets.net5.0. I include the Twilio.AspNet.Mvc NuGet package (latest version).

When my project builds, I get a bunch of warnings telling me that something is pulling in obsolete versions of Microsoft assemblies.

For example:

Warning NU1701 Package 'Microsoft.AspNet.Mvc 3.0.20105.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework .net5.0'. This package may not be fully compatible with your project.

After a bit of sleuthing, it appears that the problem is because Twilio.AspNet.Mvc (v5.37.2) pulls in, among other things, Microsoft.AspNet.Mvc (v3.0.20105.1).

That package has a warning:

Package 'Twilio.AspNet.Mvc 5.37.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework .net5.0'. This package may not be fully compatible with your project.

I tried removing and reinstalling the Twilio package, but that didn't help.

The package documentation says that you should use Twilio.AspNet.Core .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM