Microsoft KB Archive/926504

= You may receive a compilation error when you compile a Windows Workflow Foundation project if you add rules in the code and in the .rules file =

Article ID: 926504

Article Last Modified on 11/24/2006

-

APPLIES TO


 * Windows Workflow Foundation

-



SYMPTOMS
You compile a Microsoft Windows Workflow Foundation solution with one rule in the code and the other defined in the &quot;.rules&quot; file. In this scenario, you may receive a compilation error that resembles the following:





CAUSE
This problem occurs because at build time there is no rule defined for the IfElse activity.



WORKAROUND
To work around this problem, use one of the following method.

Method 1

Specify a placeholder rule at design time, and replace with the desired rule by using code at runtime,

Method 2

Use a code condition. The code condition is based on the same application logic that will be used to define the rule which is defined at runtime.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem

 * 1) Create a Windows Workflow Foundation project in Microsoft Visual Studio 2005.

Note Visual Studio 2005 Extensions for Windows Workflow Foundation must be installed on the computer.
 * 1) Add two activities in the project, and then drop two IfElse controls in the two activities.
 * 2) Set the rule of one IfElse branch in the code.
 * 3) Set the rule of another IfElse branch in the .rules file by using the Rule Set Editor dialog box.
 * 4) Compile the project.

You may receive the compilation error that is described in the &quot;Symptoms&quot; section.

Keywords: kbtshoot kbprb KB926504

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.