I have a silverlight application and am using init params to pass an API server URL through from my web config to the host page to the App.xaml.cs
The API url contains “localhost” then a port number.
But when it gets to the App.xaml.cs in debug mode it’s being passed in as “::1” then the port number.
Why is this? Any way other than simply checking for “::1” and converting it back to “localhost”?
edit
This is the hosted page’s markup where I send the init params.
<param name="initParams" value="<%=string.Format("APIServer={0}, PivotServer={1}", ConfigurationManager.AppSettings["APIServer"],ConfigurationManager.AppSettings["PivotServer"] ) %>" />
This is where I extract the init params:
private void Application_Startup(object sender, StartupEventArgs e)
{
apiServer = e.InitParams["APIServer"];
}
I’m simply checking for it and changing it at runtime.