Windows Home Server and the Task Parallel Library


  • Firstly apologies as this is a cross post question from stack overflow - Sorry if this is against the rules!


    I have some very simple class library with code as follows:-

    public Task<string> ConnectAsync()
        Task<string> result = Task.Factory.StartNew(()=> Connect());
        return result;
    public string Connect()
        return "Test";

    In my front end I have the following:

    Task<string> myTask = connection.ConnectAsync();
    myTask.ContinueWith(ant =>
        label1.Invoke((MethodInvoker)(() => label1.Text = ant.Result));

    In a normal windows form this works as expected, no UI lock up's. However when I push exact code out as a windows home server 2011 plugin its a different storey. The UI locks up and eventually the dashboard is killed automatically.

    Any help would be really appreciated!




    27. oktober 2011 11:55