I am getting the title error when I do the code in .netcore2.2.
Following is my code,
var browser = Request.Browser;
System.Web.HttpBrowserCapabilitiesBase myBrowserCaps = browser;
HttpBrowserCapabilitiesBase in this keyword it showing me the title error.
While this code is working perfectly below the .netcore2.2. HttpBrowserCapabilitiesBase is the interface of System.web DLL below the .netcore2.2.
It means the updated .net framework this namespace is not exist now which namespace is work, that I am not getting.
Depending on which information you need, you could look that up in the headers (e.g.
Request.Headers["User-Agent"]as shown here) instead, or get it using a library like Device Detection.Edit: Here is a tutorial for getting the device type information using the
ASP.NET Core Detectionlibrary:Wangkanai.DetectionNuGet package.Add to the
ConfigureServicesmethod in yourStartup.cs:In the controller inject:
IDeviceResolver deviceResolver... and get the device information via:
deviceResolver.Device.Type, e.g.:See the documentation for further information.