Proxy Issue

  • Hi

    I am not .net developer by any means but there are couple of applications I need to migrate as part of SQL Server migration which is written in C#. I managed to migrate one with appropriate changes of the server name and user etc. and it was straight forward. However the second application is using proxy to connect with web services API. It works on current domain. 
    Now following the migration of the application on new domain it is not working because the proxy server on new domain is different. However for some reason my proxy server variable returns the old proxy server name. I am using this code where it should return new proxy server name but it doesn’t.

    New Domain code: System.Net.WebProxy P = new System.Net.WebProxy("XX.X.X.X",8080);
    Old domain Code: System.Net.WebProxy P = new System.Net.WebProxy("YY.Y.Y.Y",8080);

    When I run the code on new server the variable P holds proxy address as YY.Y.Y.Y which is not correct. I tried to change variable (R or S from P) to other letter and then when I debug it doesn’t hold any information which is strange again. How do I test if my new domain code returns correct information but variable P has something wrong?

    Any suggestion?

  • dva2007 - Thursday, June 21, 2018 9:50 AM

    Hi

    I am not .net developer by any means but there are couple of applications I need to migrate as part of SQL Server migration which is written in C#. I managed to migrate one with appropriate changes of the server name and user etc. and it was straight forward. However the second application is using proxy to connect with web services API. It works on current domain. 
    Now following the migration of the application on new domain it is not working because the proxy server on new domain is different. However for some reason my proxy server variable returns the old proxy server name. I am using this code where it should return new proxy server name but it doesn’t.

    New Domain code: System.Net.WebProxy P = new System.Net.WebProxy("XX.X.X.X",8080);
    Old domain Code: System.Net.WebProxy P = new System.Net.WebProxy("YY.Y.Y.Y",8080);

    When I run the code on new server the variable P holds proxy address as YY.Y.Y.Y which is not correct. I tried to change variable (R or S from P) to other letter and then when I debug it doesn’t hold any information which is strange again. How do I test if my new domain code returns correct information but variable P has something wrong?

    Any suggestion?

    Usually you would debug this in Visual Studio just as you did when changing the variables. You can use the watch window to track the value of variables.
    Did you search the code for the variable to see where it is being initialized? If the variable has the wrong value, it's specified, set somewhere in the code.

    Sue

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply