I have a relative URI:
Uri U = new Uri("../Services/Authenticated/VariationsService.svc", UriKind.Relative);
The problem is that depending on whether the user typed https: // or http: // into his web browser to access the silverlight application, he can use either http or https when trying to contact the service.
I want to force the program to use https to connect to the service anyway.
I originally tried this:
Uri U = new Uri("../Services/Authenticated/VariationsService.svc", UriKind.Relative); string NU = U.AbsoluteUri; U = new Uri(NU.Replace("http://", "https://"), UriKind.Absolute);
But it fails in U.AbsoluteUri because it cannot convert relative Uri to absolute Uri at this point. So how do I change the Uri scheme to https?
source share