I had a similar problem (500 error), but mine hiccupped around 5.2.5, and continued through 5.3.0 until today. (2/12/25)
I was just now able to get 5.3.0 to work.
In my case, the problem seems to have been related to the C#/NuGet combo doing a horrible job of cleaning up the web.config file, and leaving detritus from previous versions. So in a fresh project, I installed Microsoft.AspNet.WebApi to the latest version, and observed what it had added to the web.config, and then replaced that section in the Web.Config for my project.
Particularly messy and suspicious was the handlers section. I tried to copy that here, but it's not displaying correctly. :( Basically, it's pretty horrific. But removing the brackets, I can paste it.
add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
remove name="ExtensionlessUrlHandler-Integrated-4.0" /> remove name="OPTIONSVerbHandler" />
-- The above is really ugly, right? ---
So I substituted from the fresh project with the installed NuGet libraries (including the AjaxFileHandler, as I need that).
in 'handlers' of the working web.config... much simpler:
add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"
remove name="ExtensionlessUrlHandler-Integrated-4.0"
remove name="OPTIONSVerbHandler"
remove name="TRACEVerbHandler"
add name="ExtensionlessUrlHandler-Integrated-4.0" path="." verb="" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"
And now (with that update to the web.config) the newest (as of 2/12/25) Microsoft.AspNet.WebApi libraries are happy in my project, and do not cause a 500 error.
This is a 'going backwards to the original state, does not produce the original state' effect, your detritus may differ. I think that process in physics is called 'hysterisis', but I must be misspelling it. (Been many years...)
But I've noticed for a while that if you perform an 'undo' or uninstall or 'go back versions' in NuGet, it does a horrible job in updating/reverting the web.config file, and sometimes the packages.config files.
So sometimes you may need to take a clean project, add your NuGet libraries, and just see what's supposed to occur the config files... and make manual corrections based on that.
Obviously this sort of surgery is a bit dangerous. Please keep backup copies, and try to not be too busy with other projects while you attempt this. Test afterwards. But, looks like problem is solved for me. Will continue testing.
Good luck!