Delen via


Simple In-Memory Sample

Download sample

This sample demonstrates how to compile and run a workflow code file (in C# or Visual Basic) at run time.

The sample includes a file that defines a workflow (SequentialWorkflow.cs or SequentialWorkflow.vb), but the application does not access the workflow class directly; instead, it passes the file names of the workflow code files to a WorkflowCompiler object and retrieves the workflow instance type from the CompiledAssembly property of the WorkflowResults object. The retrieved workflow instance type is then passed to the CreateWorkflow method of WorkflowRuntime, and the resulting instance is started normally.

The workflow used for this sample is the same workflow that is presented in the Simple Sequential Workflow sample. See the Simple Sequential Workflow Sample for more information.

To build the sample

  1. Download the sample by clicking Download Sample.

    This extracts the sample project to your local hard disk.

  2. Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.

  3. Go to the source directory of the sample.

  4. At the command prompt, type MSBUILD <Solution file name>.

To run the sample

  1. In the SDK Command Prompt window, run the .exe file in the SimpleInMemorySample\bin\debug folder (or the SimpleInMemorySample\bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample.

See Also

Reference

WorkflowCompiler

Other Resources

InMemory Samples

© 2007 Microsoft Corporation. All rights reserved.