Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables["REMOTE_ADDR"] does not work.
Request.ServerVariables["REMOTE_ADDR"]
The API has been updated. Not sure when it changed but according to Damien Edwards in late December, you can now do this:
var remoteIpAddress = request.HttpContext.Connection.RemoteIpAddress;
2.1m questions
2.1m answers
60 comments
57.0k users