Problem running my first workflow enabled webform

Dear All,

I'm downloaded the asp.net example from http://www.windowsworkflow.net/default.aspx tabindex=4&tabid=41 section technology samples -> ASP.NET Workflow Example.

when i try to run the sample on my machine i get the following error..

Compiler Error Message: CS0234: The type or namespace name 'Web' does not exist in the namespace 'System.Workflow.Runtime.Hosting' (are you missing an assembly reference )

Source Error:

Line 25: using System.Collections.Generic;
Line 26: using System.Workflow.Runtime;
Line 27: using System.Workflow.Runtime.Hosting.Web;
Line 28: 
Line 29: 

& cannot open & edit the workflow file..for this i guess it's related to the version of the workflow. the example is built on beta1 & it's using paramaeters..

Kindly, I need a guide on how to run my first project. I'm working on VS 2005 final release & WWF beta2..

Thanks,
Lina



Answer this question

Problem running my first workflow enabled webform

  • melbsurfer

    You are running the beta 1 sample on beta 2. Try downloading from the beta 2 page [1] instead.

    Matt

    [1] http://www.windowsworkflow.net/default.aspx tabindex=4&tabid=49



  • ThE ViKinG

    Thanks Matt, I downloaded Beta2 samples & now i'm getting this error:

    Compiler Error Message: CS0103: The name 'WorkflowWebRequestContext' does not exist in the current context

    Source Error:

    Line 49:     //
    Line 50:     // NOTE: This requires the configuration section to be named "WorkflowRuntime".
    Line 51:     WorkflowRuntime workflowRuntime = WorkflowWebRequestContext.Current.WorkflowRuntime;
    Line 52:     
    Line 53: 

    Please advice,
    Thanks

    Lina


  • The Edge also develops software

    Are you using Beta2, or beta 2.2 This class was removed for beta 2.2 and the sample will not work as written. You'll need to instantiate the runtime yourself being sure to pass in the name of the configuration section.

    Matt



  • Jonathan_Gr

    You'll want to have a static variable somewhere of the type workflowruntime. THe easiest way to do it is to create a class with a static private member and a static property get. Then use that to get your runtime instance:

    public static myclass

    {

    private static WorkflowRuntime _runtime;

    public static WorkflowRuntime Runtime

    {

    get{

    if (_runtime == null)

    _runtime = new WorkflowRuntime("WorkflowRuntime");

    return _runtime;

    }

    }

    Then access your runtime from here rather than the request context as you did before beta 2.2.

    Matt



  • techexpert78

    I'm using Beta 2.2. I'm new to this can you please list some code on how to do this, or a reference on how to instantiate the runtime

    Thanks,
    Lina

  • Problem running my first workflow enabled webform