locked
XC1020: Build error occurred in the XAML MSBuild: 'Unable to call 'WriteValue' in current state' RRS feed

  • General discussion

  • I went through the WF Migration Kit CTP 2 tutorial that migrates a WF3 workflow that uses HandleExternalEvent and CallExternalMethod activities in order to exchange data with the host application. I completed tasks 1 through 5. I created a C# console application to test the WF4 workflow. Then, I added the VotingServiceWorkflow.xaml file to the project, added a WriteLine activity to each branch of the Pick activity, changed the name of the 'Alias' property to 'Alias2', and copied and pasted the test program to run the workflow. I then added references to WF3Activities.dll, System.Activities.dll, System.ServiceModel, System.ServiceModel.Activites, and System.Xaml. I ran the test program to confirm that it runs the same as the WF3 sample, and I got an "XC1020: Build error occurred in the XAML MSBuild task: 'Unable to call 'WriteValue' in current state" error. I googled the error and found nothing useful. Any help would be appreciated.
    • Changed type LeoTang Sunday, October 28, 2012 2:57 PM
    Wednesday, October 17, 2012 1:37 PM

All replies

  • Hi,

    As you created a workflow service which expose WCF service operation via message activities, the WriteLine activity is unavailable in this workflow service if you didn't specify a proper TextWriter. If no writer is available, the WriteLine activity writes its Text out to the console.

    If this is not your case, please post your workflow definition here. Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 19, 2012 6:07 AM
  • Thanks for the reply. I want the WriteLine activity to write its Text out to the console. Any idea how to fix the 'Unable to call 'WriteValue' in current state' error?

    Friday, October 19, 2012 4:53 PM
  • Hi,

    If you host the workflow via WorkflowServiceHost, I don't think you can write text out to the console directly. Normally, we need to call a service operation to get output. If you want to debug your workflow service, you might consider using Debug.WriteLine Method (String).

    http://msdn.microsoft.com/en-us/library/9z9k5ydz.aspx

    Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 22, 2012 3:54 AM
  • I tried replacing the Console.WriteLine calls with Debug.WriteLine calls, but I still got the same error. I even removed all the WriteLine calls, and I still got the 'Unable to call 'WriteValue' in current state' error. I don't believe there is a problem with WriteLine.

    Tuesday, October 23, 2012 4:01 PM
  • Hi,

    Can you share you the code of .xmal file with us, so that we can use it to reproduce this issue? Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 26, 2012 1:53 AM
  • The error is gone. The "Unable to call 'WriteValue' in current state." build error seems to only indicate that there are errors in the XAML file. Once those errors are fixed, the build error goes away.
    Friday, November 9, 2012 4:31 PM