locked
Deploying WWF Beta 2... RRS feed

  • Question

  • Hi,

    I've got a problem - my workflows work on the development pc but not on the production server. I'm using WWF Beta 2, both machines are in a very similar hardware configuration.

    The error message that i'm getting is: "Cannot create more than one WorkflowRuntime per AppDomain".

    The way that i'm creating WorkflowRuntime object is as follows:

    public WorkflowRuntime WFRuntime

    {

    get

    {

    if (_runtime == null )

    {

    try

    {

    _runtime = WorkflowWebRequestContext.Current.WorkflowRuntime;

    }

    catch (Exception)

    {

    _runtime = new WorkflowRuntime();

    }

    }

    return _runtime;

    }

    }

     It appears that WorkflowWebRequestContext.Current is null, which throws an exception and a new WorkflowRuntime() should start... but that does not work on the server for some reason. Am i missing something extremly obvious?

    The application it self is a ASP.NET 2.0 with SqlPersistanceService and Tracking options.

    Thanks in advance,

    Nick Goloborodko

    Thursday, May 11, 2006 11:41 PM

Answers

  • Starting with Beta 2.2 WorkflowWebRequestContext has been removed.  Please take a look at the ASP.NET samples that I have on my blog for examples of how to create the workflow runtime in Application_Start.
    Thursday, May 11, 2006 11:55 PM
  • A better place to ask this question can be found at http://www.microsoft.com/office/preview/community/newsgroups.mspx.  They will be help to help with Sharepoint specific questions, if they have a new method or accessing the runtime.
    Friday, June 9, 2006 10:56 PM

All replies

  • Starting with Beta 2.2 WorkflowWebRequestContext has been removed.  Please take a look at the ASP.NET samples that I have on my blog for examples of how to create the workflow runtime in Application_Start.
    Thursday, May 11, 2006 11:55 PM
  • It sounds like you have a configuration problem. Make sure you have the configuration section correctly named in your web.config and that you have the httpmodule configured as well. 

    Matt

    Friday, May 12, 2006 1:30 AM
  • Hi Tom,

    Thanks for your reply. I have tried installing beta 2.2, but as you mentioned WorkflowWebRequestContext object is no longer supported in beta 2.2, and since i haven't developed the workflow myself (the person who did is curently on vacation, i'm the lucky one who gets to deply the thing) i cannot make the changes required to make it Beta 2.2 compatible.

    Any other pointers are greatly appreciated,
    Nick Goloborodko

    Friday, May 12, 2006 1:37 AM
  • Can you post the contents of your web.config file?  I don't need to see the compilation section.  If you are using WorkflowWebRequestContext you shouldn't be making a call to new WorkflowRuntime.  Calling WorkflowWebRequestContext.Current creates a new workflow runtime if there isn't one already.  If you have a problem with your web config file this might be what is causing the first instance to be created correctly, but it does exist in the app domain.  What is the exact error message you get when you make the call to WorkflowWebRequestContext.Current.WorkflowRuntime?
    Friday, May 12, 2006 5:52 AM
  • Hi guys.
    I'm having a similar problem but I'm working with Windows Sharepoint Services.
    I read some posts and articles about the WorkflowWebRequestContext remotion in Beta 2.2 but I still don't get how to make a different approach for this problem.

    Quoting "Microsoft® Visual Studio® 2005 Extensions for Windows® Workflow Foundation, Beta 2 to Beta 2.2 Key Changes":

    7.3     WorkflowWebRequestContext will be removed

    The WorkflowWebRequestContext type will be removed to protect the WorkflowRuntime being accessed by all of the workflow instances.

    The following will be added to WorkflowWebService:

      protected WorkflowRuntime WorkflowRuntime { get; }


    I using WF with Windows Sharepoint Services through its Forms Libraries. These Libraries support Event Handling by .NET Assemblies, so I use a class to call the Workflow but I can't use WorkflowWebRequestContext to get the current WorkflowRuntime


    Any idea?
    TIA

    Leonardo Ludueña
    Friday, June 9, 2006 9:05 PM
  • A better place to ask this question can be found at http://www.microsoft.com/office/preview/community/newsgroups.mspx.  They will be help to help with Sharepoint specific questions, if they have a new method or accessing the runtime.
    Friday, June 9, 2006 10:56 PM
  • Sorry, but the problem is not in Sharepoint, the problem is the remotion of WorkflowWebRequestContext and how to replace it in Beta 2.2 in order to obtain the same functionality.
    Thanks for your derivation but it isn`t helpful. I read some posts about different approachs but I found examples only for ASP.NET

    Leonardo Ludueña
    Saturday, June 10, 2006 8:04 AM
  •  Leonardo Ludueña wrote:
    Sorry, but the problem is not in Sharepoint, the problem is the remotion of WorkflowWebRequestContext and how to replace it in Beta 2.2 in order to obtain the same functionality.

    Since WorkflowWebRequestContext was removed the user is now responsible for creating and storing the runtime.  You may be lucky and find someone in this forum that also uses Sharepoint and knows about the new method of accessing the runtime.  I was just suggesting that you would probably get you question answered quicker with the Sharepoint newsgroup. 

    Saturday, June 10, 2006 3:28 PM