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."
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
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.