cvalueapp
cvalueapp

Reputation: 199

Microsoft.AspNet.WebApi.Core and outdated libraries

I am following a tutorial (this one in particular https://www.twilio.com/docs/usage/tutorials/how-to-secure-your-csharp-aspnet-web-api-app-by-validating-incoming-twilio-requests) in order to create an attribute for securing my Web API webhook. I am using .NET 6 preview 7 and it seems to me that in the tutorial they are using somewhat outdated libraries (correct me if I'm wrong), such as Microsoft.AspNet.WebApi.Core and System.Web.Http. I added these libraries to my project and after several hours I got it to work and my endpoint is seemingly secured. Now, as mentioned I added the Microsoft.AspNet.WebApi.Core library as a reference and Visual Studio 2022 even gives me an warning saying it might not be able to fetch the correct version of it due to version mismatching.

My question is: can this outdated library (or dependencies) interfere with my other .NET 6 API's/Web API Controllers and web infrastructure in ASP.NET Core? Typically to load other code, making me unable to leverage new functionalities, performance boosts and other improvements of .NET 6. There are a lot of DI going on and I feel like I do not have a full understanding of how everything is loaded and which libraries are actually used when I deploy my app to IIS. Ideally I would like to port this attribute class to use the latest .NET 6 libs but many of these objects and properties are handled differently in the newer libraries as I understood.

Upvotes: 0

Views: 408

Answers (1)

cvalueapp
cvalueapp

Reputation: 199

Thanks Daniel A. White for the help. My problem was that my endpoint is hosted on sub path and therefore the RequestRawUrl method in the example fetched slightly wrong URL.

Upvotes: 1

Related Questions