BizTalk Schema Problems: The type or namespace name ‘SerializableAttributeAttribute’ does not exist in the namespace

  • Sandro Pereira
  • Jul 3, 2018
  • 3 min read

An error never comes alone … When an error appears, it always appears two or three, and I still have thousands to publish, but this one made me crazy for a few minutes: The type or namespace name SerializableAttributeAttribute does not exist in the namespace!

Yes, you read it right, while I was trying to compile a RosettaNet schemas project, in this particular case, a PIP3B2 Advance Shipment Notification, I got thousands of errors, 3054 to be exact, saying:

Error 1 The type or namespace name ‘SerializableAttributeAttribute’ does not exist in the namespace

RosettaNet.Common.Schemas._3B2.System’ (are you missing an assembly reference?)

C:\TFS\…\RosettaNet.Common.Schemas.3B2\Domain\Logistics\CodeList\RN_FreightPaymentTerms_01_03.xsd.cs 9 13 RosettaNet.Common.Schemas.3B2 …

Error 3054 The type or namespace name ‘NonSerializedAttribute’ does not exist in the namespace ‘RosettaNet.Common.Schemas._3B2.System’ (are you missing an assembly reference?) C:\TFS\…\ RosettaNet.Common.Schemas.3B2\Domain\Procurement\INT_Procurement_02_07_01_09.xsd.cs 5072 21 RosettaNet.Common.Schemas.3B2

… and several other schemas, as you may see in the picture below.

namespace name 'SerializableAttributeAttribute' does not exist in the namespace

But do not be fooled into thinking this is a problem related exclusively to RosettaNet, it is not, and it can happen with any “normal” or any kind of schemas.

📝 One-Minute Brief

A troubleshooting guide that explains why BizTalk schema compilation fails with the error “The type or namespace name ‘SerializableAttributeAttribute’ does not exist” and how to fix invalid or duplicated attributes in BizTalk XSD schemas.

Cause

There are certain keywords, type names, and identifier names that you should use because they are internally used by BizTalk, and they may come into conflict and sometimes cause problems and errors. Keywords like activate, atomic, body, task, compensate, method, and several others, you can see the full list here: XLANG-s Reserved Words. But there are other keywords that, depending on the artifact, may give you problems like:

  • BTS (associated with Microsoft.BizTalk.GlobalPropertySchemas assembly).
  • “-“ in RootNode Typename inside schemas.

And System!

If you use the keyword System inside a schema namespace like:

  • RosettaNet.Common.Schemas._3B2.System
  • MyNamspace.System.Schemas

You will not be able to compile your schema project.

The problem, if you download from the GS1 RosettaNet Standards, certain PIP’s they will have the following structure:

namespace name 'SerializableAttributeAttribute': RosettaNet PIP3B2 Sctructure

And as you see, there is a folder System that inside has several schemas, and normally the schema namespace is composed of the project name or (assembly name) and the path to the schema, for example, in this case:

  • RosettaNet.Common.Schemas._3B2.System.CodeList.
  • Or RosettaNet.Common.Schemas._3B2.System.

And this is causing all of these problems because, in this case, System is a reserved keyword that shouldn’t be used.

Solution

The difficult part of this error was finding its cause. Once you know what is causing the problem, the solution is quite simple. You just need to:

  • Change the Namespace property on all the schemas from the word System to another name, for example, _System (to maintain the consistency, but it can be another word/value).

In my case, I hade the change the Namespace property of the schemas in the System folder.

namespace name 'SerializableAttributeAttribute': Change schema namespace

You can now rebuild your schema solution, and this error should go away.

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top