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.

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.