When survey validation fails and displays a Compilation Error similar to:
Response_xxxx_Test.cs(xxxxx, x): warning: Empty switch block
Response_xxxx_Test.cs(xxxxx, x): error: The name <QuestionName> does not exist in the current context.
The Compilation Error may be referring to an invalid pipe or an incorrect question reference in a script. If the error is pointing to a pipe or script, you can follow the steps below to find the item causing the issue.
Detailed Steps
Find the pipe causing the compilation error
- Navigate to the Preview tab.
- Press CTRL+F on your keyboard to open the Find feature.
- Search for [% to find the beginning of a pipe.
- Use the Next button to navigate through the study preview to find pipes.
- Make required changes to the relevant pipe under the Questionnaire tab and attempt to Validate the study.
Find the script causing the compilation error
- Click the Validate button to retrieve the Compilation Error.
- View the summary.
- Find the reference to the question containing the script.
- The line after the warning: Empty switch block will contain the question name.
For Example: Compilation error(s) occurred in the OnLoad method of the "Test2" ChoiceQuestion:
In the above example, Test2 is the name of the question with the erroneous script.
- Navigate to the question name mentioned in the Compilation Error.
- Edit or remove the script.
- Edit the script will require updating the question name in the script to reflect the new question name from the study.
- Remove the script entirely to successfully validate. Re-author the script if required.
More Information
Read this WebHelp article to learn more about Piping.
Comments
0 comments
Article is closed for comments.