Error message when you build a BizTalk Server 2006 or BizTalk Server 2004 project in Visual Studio: "The type or namespace name 'SerializableAttribute' does not exist" or "The type or namespace name 'NonSerializedAttribute' does not exist" (916649)



The information in this article applies to:

  • Microsoft BizTalk Accelerator for RosettaNet 3.0 Standard Edition
  • Microsoft BizTalk Accelerator for RosettaNet 3.0 Enterprise Edition

SYMPTOMS

In Microsoft Visual Studio, you may receive an error message that resembles one of the following messages when you build a Microsoft BizTalk Server 2006 or Microsoft BizTalk Server 2004 project that uses XML Schema definition language (XSD)-based Partner Interface Process (PIP) schemas:

Error message 1

The type or namespace name 'SerializableAttribute' does not exist in the namespace 'ProjectName.System' (are you missing an assembly reference?)

Error message 2

The type or namespace name 'NonSerializedAttribute' does not exist in the namespace 'ProjectName.System' (are you missing an assembly reference?)
Note In this error message, ProjectName represents the name of the BizTalk Server project.

This problem occurs when the project contains XSD Schemas in a subfolder that is named System.

CAUSE

This problem occurs because the namespace that is created for the documents in the System folder is the ProjectName.System namespace.

Note ProjectName represents the name of the BizTalk Server 2004 project.

BizTalk Server generates code that uses the System.Serializable attribute and the System.NonSerialized attribute. Therefore, the C# compiler assumes that the Serializable attribute and the NonSerialized attribute are Microsoft .NET types that are defined under the ProjectName.System namespace.

RESOLUTION

To resolve this problem, change the namespace for the schemas in Visual Studio. To do this, follow these steps:
  1. In Visual Studio, click Solution Explorer on the View menu.
  2. On the Project menu, click Show All Files.
  3. In Solution Explorer, expand System.
  4. Click each file in the System folder and in any subfolders, and then change the namespace entry in the Properties window so that any occurrence of System becomes _System. For example, change the MyProject.System.SubFolder namespace to the MyProject._System.Subfolder namespace.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MajorLast Reviewed:4/26/2006
Keywords:kbBug kbBTSAccelerators kbBTS kbtshoot kberrmsg kbprb KB916649 kbAudDeveloper