"ServiceObjectModel AutoCompiler" error when publishing a Service Object on K2 Visual Studio

  • 24 February 2022
  • 0 replies

Userlevel 4
Badge +17

"ServiceObjectModel AutoCompiler error when publishing a Service Object on K2 Visual Studio


K2 connect
K2 connect (all)
K2 Designer for Visual Studio
K2 connect for SAP
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.
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.


When publishing a Service Object on K2 Visual Studio, the following error is returned:


"ServiceObjectModel AutoCompiler error CS0542: 'BAPIFLAG': member names cannot be the same as their enclosing type"


The error shown is a C# generated error. It indicates that one of the properties/fields has the same name as the service or another object. The issue occurs because the friendly name for this attribute is the same as the function name.

Troubleshooting Steps

To resolve this, please follow the example below:

1. Edit the structure for the function type 'BAPIFLAG':


2. Change the Friendly name or the Function Name:


3. Perform the same steps for any other attribute(s) shown in the error.

4. Re-publish the Service Object again.

0 replies

Be the first to reply!