views:

11

answers:

0

I get this error

System.UriFormatException [net_uri_BadFormat] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50826.0&File=System.dll&Key=net_uri_BadFormat at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString) at System.ServiceModel.EndpointAddress..ctor(String uri) at Lanco.OrderSystem.SilverlightServicesFactory.GetConverterClient()

This error is caused trying to display a XAML page in the designer on a Silverlight project. The page has one control on it. That control has this code

    private void UserControl_Loaded(object sender, RoutedEventArgs e)
    {
        if (DesignerProperties.GetIsInDesignMode(this)) return; // this doesn't seem to prevent the problem
        _factory = new SilverlightServicesFactory();
        _client = _factory.GetConverterClient();
        //...

The code for the SilverlightServicesFactory

public class SilverlightServicesFactory
{
    public ConvertersClient GetConverterClient()
    {
        const string endpoint = "../Services/Converters.svc";
        var endpointAddress = new EndpointAddress(endpoint);
        var binding = new BasicHttpBinding();
        var client = new SilverlightServices.ConvertersClient(binding, endpointAddress);
        return client;

    }
}

What is the correct way to handle relative URIs with WCF and Silverlight 4?

This code works...but I can't view the XAML Page in the designer.