I'm running into an issue adding a StructLayout attribute to a MessageContract class, for example:
[MessageContract(...)]
[StructLayout(LayoutKind.Sequential)]
public class Foo { ... }
This causes a nasty error when trying to generate the WSDL from WCF:
Could not load type 'Test.Foo' from assembly 'Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because the format is invalid.
I'm doing this to prevent ReSharper from automatically re-ordering elements of my class. I want them to be ordered per the DataMember/MessageBodyMember attribute's Order value.
This is really weird because it works on Data Contracts, just not Message Contracts for some reason.