Strange behaviour with Microsoft.WindowsCE.Forms

Posted by Mohammadreza on Stack Overflow See other posts from Stack Overflow or by Mohammadreza
Published on 2009-06-16T07:42:55Z Indexed on 2010/06/07 23:32 UTC
Read the original article Hit count: 353

I have a Windows Mobile application in which I want to check the device orientation. Therefore I wrote the following property in one of my forms:

internal static Microsoft.WindowsCE.Forms.ScreenOrientation DeviceOriginalOrientation { get; private set; }

The strange thing is that after that whenever I open a UserControl, the designer shows this warning even if that UserControl doesn't use the property:

Could not load file or assembly 'Microsoft.WindowsCE.Forms, Version=3.5.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Commenting the above property will dismiss the warning and shows the user control again. The application is built successfully and runs without any problems in both cases.

Does anybody know why this happens and how can I fix it?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio-2008