Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

.net core message showing when run in debug on local pc but not on server

$
0
0

Hi,

using .netcore 2.1 had code below working in 2.2 a few months work back

have variable badIp

How can we get message returned to screen when badIp = true

when have badIp = false then shows data entry as expected

Below still works on local pc but doesn't show when publish on server no message returned to screen when use chrome.

 badIp = true;

            if (badIp) 
            {
                 _logger.LogInformation(
                 " Please contact IT  to add your ip address to list of valid ip addresses. Forbidden Request from Remote IP address: {RemoteIp}", remoteIp);
                context.Result = new StatusCodeResult(200);
                string valueString = "Only whitelisted I.P. Addresses may access this application." +"\r\n" +"\r\n" +"Please contact IT team to determine if your IP address can be added for access";
                context.HttpContext.Response.WriteAsync(valueString);
                return;

            }

                       

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>