When creating a new Package with P&D, an error appears: "A type with the same name and namespace already exists in the model..."

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 creating a new package with the K2 Package and Deployment tool, the following error will be presented:

"A type with the same name and namespace already exists in the model. name = '[Property\FieldName]' and namespace 'urn:[ViewName]#Sources.[GUID.Fields]"

Image

Symptoms

This issue will appear before the package is created.

Firstly, the following error will be shown:

Image

If you click on the above error, the full error message will be displayed.

Your package will deploy on your target environment, however, your artifacts may not function as expected.

Additionally, you may see duplicate "List Methods" on a single View.

Resolution

The issue is caused by duplicates within the Form or View. 

Our developers have created a script to resolve this issue, please contact K2 Support for further assistance - the script will remove the duplicates from the relevant Form\View.