none
mac with entity framework

    Question

  • Not sure this is the place for this, but here goes.

    I am having trouble getting a silverlight application to run on a mac. This application uses SL 2.0 and the entity framework and runs fine on a Windows machine.

    On the mac, the application starts up fine and even accesses a custom WCF service on the server OK (for security).

    At the point that I make the first request for data the program fails. If I use a relative Url it fails with an error about HtmlPage. (I didn't keep that exact error) This failure occurs in the LoadList function below.

    With an absolute url it fails with the following error. "Internal error at 'ScriptXmlHttpRequest.CreateNativeRequest', this time on the EndExecute. In searching for this error the only reference I can find about it is calling the entity framework on a non-UI thread (doesn't work).

    Does anybody have any information on this? Again, it works either way on Windows. I nailed down the exact spot of the failure by remote debugging the mac (pretty neat), but I've hit a brick wall here.

    Thanks, Bill


    public void LoadList()
    {
    string baseURI = Application.Current.Host.Source.AbsoluteUri.Substring(0, Application.Current.Host.Source.AbsoluteUri.LastIndexOf("ClientBin"));

    Uri u = new Uri(baseURI + "CredentScreenDefinitionDataService.svc", UriKind.Absolute);
    svcScreenContext = new CredentScreenDefinitionEntities(u);
    svcScreenContext.BeginExecute(
    new Uri(u.AbsoluteUri + "/view_InternetScreens?$orderby=GroupingName,Caption", UriKind.Absolute),
    new AsyncCallback(OnScreenListLoadComplete),
    svcScreenContext);
    }

    void OnScreenListLoadComplete(IAsyncResult result)
    {
    DataServiceContext dsListScreen = (DataServiceContext)result.AsyncState;
    try
    {
    IEnumerable r = dsListScreen.EndExecute(result);
    List screenListDefinition = r.ToList();
    OnScreenListLoadComplete(new ScreenListLoadCompleteEventParms(screenListDefinition));
    }
    catch (Exception e)
    {
    MessageBox.Show(e.Message);
    if (e.InnerException != null)
    {
    MessageBox.Show(e.InnerException.Message);
    if (e.InnerException.InnerException != null)
    MessageBox.Show(e.InnerException.InnerException.Message);
    }
    }
    }
    }
    Saturday, June 20, 2009 9:31 AM

Answers

All replies