HttpContext - access issue

Mar 28 2019 8:19 AM

How do I resolve this

I get this error on HttpContext, when I try to get the server Name

httpcontext is not declared it may be inaccessible due to its protection level

Dim strServerName As String = If((HttpContext.Current IsNot Nothing), HttpContext.Current.Request.ServerVariables("LOCAL_ADDR").ToString(), Environment.MachineName)


Answers (2)