I am currently trying to upgrade a logging lib from framework 4.8 to .net 6.We have the following lines of code
if (isWebApplication){ _URI = System.Web.HttpContext.Current.Request.ServerVariables["URL"];}else{ _URI = My.Computer.Info.OSFullName;}
which I am struggeling to get working again since the System.Web.HttpContext
does not exist in this form anymore.The only way to get the URL is form an existing request object, but since the logging lib should not care if it is used in a web or desktop app, I cant expect a HttpRequest object.
Are there any other generic ways to solve this?