This documentation is archived and is not being maintained.

Compiler Warning (level 3) CS0282 

Error Message

There is no defined ordering between fields in multiple declarations of partial class or struct 'type'. To specify an ordering, all instance fields must be in the same declaration.

To resolve this error, put all member variables in a single partial class definition.

A common way to get this error is by having a partial struct defined in more than one place, with some of the member variables in one definition, and some in another.

The following code generates CS0282.


This code contains one description of a struct. Compile these two modules together in a single step by means of the command:

csc /targt:library cs0282_1.cs cs0282_2.cs

partial struct A
    int i;

This code contains a conflicting description of the same struct.

partial struct A
    int j;