Using C# .NET 3.5 and WCF, I\'m trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to).
The o
This is what I was looking for thanks to @marxidad for the pointer.
public static string GetServerName()
{
string serverName = "Unknown";
Configuration appConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ServiceModelSectionGroup serviceModel = ServiceModelSectionGroup.GetSectionGroup(appConfig);
BindingsSection bindings = serviceModel.Bindings;
ChannelEndpointElementCollection endpoints = serviceModel.Client.Endpoints;
for(int i=0; i