OrientationAwareControl Designer problem

Topics: Mobile Client Software Factory
Oct 17, 2006 at 6:10 AM
originally posted by: smacksnr

I am currently working on a mobile CAB project and have created a couple OAC controls. However, now when I try and open them in the Windows Form designer I get the shown below.

I have tried all the following to no avail.:
1) Rebuilt OAC solution
2) Did a Repair of the Windows Mobile 5 PocketPC SDK installation
3) Restarted VS2005.
4) Restarted my PC
5) Changed the OAC reference to copy local.

And several combinations of the above.

Anyone have any idea what the problem/solution is?



Could not load file or assembly 'Microsoft.WindowsMobile.Status, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Hide

at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RtFieldInfo.get_FieldType()
at System.ComponentModel.Design.InheritanceService.AddInheritedComponents(Type type, IComponent component, IContainer container)
at System.Windows.Forms.Design.DocumentDesigner.Initialize(IComponent component)
at Microsoft.CompactFramework.Design.DocumentDesigner.Initialize(IComponent component)
at Microsoft.CompactFramework.Design.DeviceUserControlDocumentDesigner.Initialize(IComponent component)
at Microsoft.Practices.Mobile.UI.RootDesigner.Initialize(IComponent component) in C:\Program Files\Microsoft Mobile Client Software Factory\ApplicationBlocks\OrientationAware\Src\Designer\RootDesigner.cs:line 161
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 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
Oct 17, 2006 at 8:23 AM
originally posted by: smacksnr

UPDATE:

I tried including the OAC project into my solution instead of referencing the assembly and the problem disappears.
Oct 17, 2006 at 6:31 PM
originally posted by: dcazzulino

Adding a project reference to the OAC is not recommended.
This problem is solved if you copy the WM.Status.dll and WM.dll to public assemblies.
Oct 18, 2006 at 3:50 AM
originally posted by: smacksnr

Thanks Daniel,

I had seen that recommendation in the documentation but was looking for something that would allow me to keep working.

As an aside, why does the AdventureWorks RI use a project reference to the OAC?

Thanks

Bill
Oct 18, 2006 at 3:57 AM
originally posted by: dcazzulino

The RI in general uses project references for everything, so that you can jump from the RI to the block' source code and see how things are implemented.

Typically, however, you will use binary references to pretty much everything, as the extensibility points available in the blocks don't require you to have project references at all. That would make compilation and loading in VS much faster too (specially if you have a big number of projects).
Oct 18, 2006 at 4:38 AM
originally posted by: smacksnr

Hadn't thought about it from a learning perspective but now that you mention it, a good point.


Referencing binaries makes alot of sense too but it there a reason why the guidance package creates a local copy of all the blocks (except OAC) when it creats the solution? Yet another decision to aid learning?
Oct 18, 2006 at 4:55 AM
originally posted by: dcazzulino

In the case of the guidance package, it's more about guidance on how we think you should structure your production projects, not just your learning/prototype projects (such as the RI itself).

For a real project, it's quite common that your company will have an SCC-stored binary version of the blocks that you will use potentially across multitple projects. They may very well have a version that is different than the one included in the p&p MCSF, specially if they fix bugs, implement new features at the blocks level, etc. This is also very common.

So, I thought it would be much better if you had an actual initial copy of whatever came with the blocks, and possibly check those in your SCC. If you later perform an update to the blocks, you only need to upload the new binaries to this location, and all projects sharing them from the same location (real location or TFS-mapped location) would benefit from the upgrade/fix.

The scenario where you just stick to the binaries installed by the MCSF will be quite infrequent, IMO.

So that's why I made the solution template that way ;-). It was based on my experience with other customers using the blocks.
Oct 19, 2006 at 9:16 AM
originally posted by: m_a_madero

You can modify the guidance package to reference binaries instead of adding the projects.
I saw an architecture HOL with something about this, but I'm not sure which Software Factory has it, probably was for the Web Service SF.