OAC Error

Topics: Mobile Client Software Factory
Jan 4, 2007 at 12:36 AM
originally posted by: Iandmac

Hi Guys,

I am trying to get the OAC to work in a c#.net 2005 PPC app. but keep getting the following message:

Unable to cast object of type 'Microsoft.Practices.Mobile.UI.OrientationAwareControl' to type 'Microsoft.Practices.Mobile.UI.OrientationAwareControl'.

at Microsoft.Practices.Mobile.UI.RootDesigner.Initialize(IComponent component)
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)


I have reinstalled all componetes. rebuilt the dll. compiles with out any problem. But the moment i want to see the usercontrol designger i get this. This control does not contain any other controls or any additional code.

Any ideas?

Thanks
Jan 6, 2007 at 7:35 AM
originally posted by: dcazzulino

Is your project using a project reference to the OAC?
If so, could you try using a binary reference?
Jan 8, 2007 at 10:41 PM
originally posted by: Iandmac

I am using a binary refernce.

Any Other ideas?

Thanks
Jan 10, 2007 at 7:21 AM
originally posted by: dcazzulino

Try finding all occurrences of the OAC assemblies, and delete them.
Recompile the block.
Close and reopen VS and open your project.