localhost vs. computername with webServices

  • Thread starter Thread starter Joshua Moore
  • Start date Start date
J

Joshua Moore

I used to be able to write to the app.config file in C# using the .net
framework, but now, it seems I have to hard-code the computer name the
webService is running off of, replacing localhost. Does anyone have any
work arounds?

Thanks,
Joshua Moore
 
Joshua,

I'm surprised if you ever got localhost to work, since the CE device
considers localhost to be him and not the host computer. You can also use
the host computer's IP address, but again, it must be the real IP address
and not the localhost address.
 
I didn't get localhost to work, I hard-coded the computer name. I was
wondering what others have done, after running into this problem, to work
around having to hard code the name? Does the CE device have a registry to
write to?

Thanks for your quick response and help,
Joshua Moore
 
yes, CE has a registry, and OpenNetCF.org has the registry namespace.
the registry also contains Hosts info (as opposed to a file on the desktop).

i typically just read settings from an Xml file.
Thanks,
casey
http://www.brains-N-brawn.com
 
Joshua,

I've read the settings from an XML file and replaced the reference to
this.URL in the constructor of the web service. You can find this in
Reference.cs (C#) after you create the initial mapping. FYI, if you change
the reference in the properties dialog, the Reference.cs file will be
regenerated.

Hope this helps!

-Mike
 
Back
Top