<{{Subtitle_Weight}} class="prominent-subhead {{Show_Subtitle}}"> {{Header_Subtitle}}

K2 Studio deployment error: The expression cannot be evaluated

~~repeating-content.html~~
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

When trying to deploy a K2 workflow from K2 Studio / Visual Studio / K2 Designer, the following error appears:

"Microsoft. Build. Exceptions. InvalidProjectFileException: The expression "Expression Name" cannot be evaluated."

Symptoms

After inspecting a *.msbuild file in the project,  it seems there is a custom field value entry in the environment field, in workspace.

"Expression name example: "".OOFInput"" "

Please see the following KB article to create the .msbuild package: https://help.k2.com/kb000188

Troubleshooting Steps

After investigating, an environment field was found in the K2 Workspace Development Environment Library containing code.

Deleting this entry made it possible to successfully deploy packages using K2 Studio / Visual Studio / K2 Designer.

"Example expression name "".OOFInput"" "

This issue "Microsoft. Build. Exceptions. InvalidProjectFileException: The expression "Example expression name: "".OOFInput""  " cannot be evaluated" originates from K2 community service brokers.

Note: custom code in environment library fields is not supported.