Porting Mobile Client Software Factory to Visual Studio 2008


About six months, we posted on our p&p site that we would not be doing any further development on Mobile Client Software Factory. Since Visual Studio 2008 has shipped, I’ve been getting a bunch of questions around Mobile Client from customers who have committed to its use. Although our plans have not changed, we’ve had our sustained engineering team document the steps to upgrade the existing version in order to help those customers.

<Warning>What follows is not simple</Warning>

Installation

Problem #1

When you install Mobile Client Software Factory July 2006, an error occurs:

clip_image002[4]

Workaround

1. Download and install Orca MSI editor (which is distributed with the Windows SDK). The Orca MSI Editor is a table-editing tool that can be used to edit your .msi files. If you want to learn more about this tool, please visit this link.

Note: If you don’t want to download the Windows SDK, the Orca.msi tool is published here (Download it from this place at your own risk).

2. Open Orca MSI editor and then go to File -> Open… Select the MC-SF msi file (Mobile Client Software Factory July 2006 (refresh).msi).

3. Select the RegLocator table from the tables list.

clip_image003[4]

4. Modify the following key values (replace the 8.0 with 9.0 in the paths) from this table:

· GAXRegistry

· FindVSInstallDir

5. Save the changes.

6. Run the MSI file.

Problem #2

When the installer tries to build some solutions, an error occurs:

CaBGen.sln (or ObGen.sln, or OrientationAware.sln, or MobileClientFactory.sln) is from a previous version of Visual Studio and must be converted in order to build in this version of Visual Studio. To convert the solution, open the solution in this version of Visual Studio.”

clip_image005[4]

1. Open %Microsoft Mobile Client Software Factory Install Folder%\Tools\CabGen\CabGen.NoTests.sln in Visual Studio 2008.

a. Run the Conversion Wizard.

b. Copy the Microsoft.Cci.DLL in CabGen\Lib folder (This assembly is distributed with FxCop)

c. Compile the solution.

d. Compilation errors:

· “The name ‘Properties’ does not exist in the current context”

clip_image006[4]

Workaround

Replace ‘Properties’ text for ‘Microsoft.Practices.Mobile.CompositeUI.CodeGen.Properties’.

2. Open %Microsoft Mobile Client Software Factory Install Folder%\Tools\ObGen\ObGen.NoTests.sln in Visual Studio 2008.

a. Run the Conversion Wizard.

b. Copy the Microsoft.Cci.DLL in ObGen\Lib folder (This assembly is distributed with FxCop)

c. Compile the solution.

d. No compilation errors.

e. Compilation warnings!

3. Open %Microsoft Mobile Client Software Factory Install Folder%\ApplicationBlocks\OrientationAware.NoTests.sln in Visual Studio 2008.

a. Run the Conversion Wizard.

b. Compile the solution.

c. No compilation errors.

d. No compilation warnings.


Guidance Package

a. Open %Microsoft Mobile Client Software Factory Install Folder%\GuidancePackage\MobileClientFactory.NoTests.sln in Visual Studio 2008.

b. Run the Conversion Wizard.

c. Compile the solution.

d. Compilation errors:

· “The type or namespace name ‘Design’ does not exist in the namespace ‘Microsoft.VisualStudio.Shell’”

clip_image007[4]

Workaround

Install Visual Studio 2008 SDK (Microsoft.VisualStudio.Shell.Design assembly is included in this SDK, %Microsoft Visual Studio 2008 SDK Install Folder%\VisualStudioIntegration\Common\Assemblies).

Now, register the Guidance Package. (Without problems)

e. Compilation warnings!


Reference Implementation – AdventureWorksToGo

a. Open solution.

b. Run the Conversion Wizard.

c. Compile the solution.

d. Compilation errors:

· “System.IO.Stream.Dispose(bool)’ is inaccessible due to its protection level”

clip_image008[4]

Workaround

                Two options:

· #1:

The .NET Compact Framework 2.0 does not support the Dispose method for the memory stream. You can comment out the few lines in GetTypedDataSetSchema method (from RI1OfflineDatastoreDataSet.Designer.cs file):

finally
{
   if ((s1 != null))  {   //s1.Dispose();
  }
   if ((s2 != null))
  {
   //s2.Dispose();
  }
}

· #2:

Upgrade project to .NET Compact Framework 3.5.

Right click on AWToGoShell project and select Upgrade project… option.

clip_image009[4]

f. Compilation warnings!


Create a new Mobile Application / Create a Composite UI Module – Error

clip_image010[4]

Fig. 1 | ModuleLoaderService error.

Workaround

1. Make sure that the Composite UI Module builds to the same location as the Shell assembly.

2. Make sure that the Composite UI Module is set to deploy using the Configuration Manager on the Mobile CAB solution (see Fig. 1.1).

clip_image011[4]

Fig. 1.1 | Solution Configuration Manager.

Add Orientation Aware Control – Warning

Orientation Aware Controls seem to crash when trying to open them in the control design view:

at System.ComponentModel.TypeDescriptor.AddAttributes(Object instance, Attribute[] attributes)

at Microsoft.VisualStudio.Design.VSDesignSurface.CreateDesigner(IComponent component, Boolean rootDesigner)

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)

clip_image012[4]

Fig. 2 | Orientation Aware Control designer

Details

This is a known issue for all OAC editions (Professional, Community and MS P&P).

The Clarius Team is working on this problem. (Note: Mobile Client Software Factory includes an earlier version of the Orientation Aware Control developed by Clarius for Microsoft.)

In order to get updated information on this issue, you can see this thread.

Create Disconnected Service Agent – Error

When you try to create a Disconnected Service Agent from the recipe, an error occurs:

Microsoft.Practices.RecipeFramework.ValueProviderException: An exception occurred during the binding of reference or execution of recipe CreateDisconnectedServiceAgent. Error was: An error happened while calling the value provider or evaluating the default value of argument ProxyType..

You can remove the reference to this recipe through the Guidance Package Manager. —> System.InvalidOperationException: Type MyShell.localhost.Service1 from file C:\Users\southy\Documents\Visual Studio 2008\Projects\MobileApplication15\Source\MyShell\Web References\localhost\Reference.cs has not been compiled yet. Recompile project and retry.

   at Microsoft.Practices.Mobile.SoftwareFactory.DteConverter.ToType(CodeClass codeClass) in C:\Program Files\Microsoft Mobile Client Software Factory\GuidancePackage\MobileClientFactory\DteConverter.cs:line 100

   at Microsoft.Practices.Mobile.SoftwareFactory.DteConverter.ToType(FileCodeModel codeModel) in C:\Program Files\Microsoft Mobile Client Software Factory\GuidancePackage\MobileClientFactory\DteConverter.cs:line 58

   at Microsoft.Practices.Mobile.SoftwareFactory.DteConverter.ToType(ProjectItem item) in C:\Program Files\Microsoft Mobile Client Software Factory\GuidancePackage\MobileClientFactory\DteConverter.cs:line 45

   at Microsoft.Practices.Mobile.SoftwareFactory.DisconnectedAgent.ProxyTypeValueProvider.OnBeginRecipe(Object currentValue, Object& newValue) in C:\Program Files\Microsoft Mobile Client Software Factory\GuidancePackage\MobileClientFactory\DisconnectedAgent\ProxyTypeValueProvider.cs:line 44

   at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)

   — End of inner exception stack trace —

   at Microsoft.Practices.RecipeFramework.Recipe.CallProviders(IDictionary providers, IDictionaryService readonlyArguments, IDictionaryService arguments, Boolean isBefore)

   at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)

   at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)

   at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(IAssetReference reference)

   at Microsoft.Practices.RecipeFramework.RecipeReference.OnExecute()

   at Microsoft.Practices.RecipeFramework.AssetReference.Execute()

   at Microsoft.Practices.RecipeFramework.VisualStudio.RecipeMenuCommand.OnExec()

   at Microsoft.Practices.RecipeFramework.VisualStudio.AssetMenuCommand.Invoke()

clip_image014[4]

Fig. 3 | Create Disconnected Service Agent – Recipe Error

Workaround

1. Build solution.

2. Close Visual Studio 2008.

3. Re-open solution.

4. Execute “Create Disconnected Service Agent” recipe.

Comments (11)

  1. John Diss says:

    Thanks for this Glenn, its a life saver cheers jd

  2. John Diss says:

    FYI: In order to install the guidance package I needed to orca the output of the ‘Guidance Package’ section above and add /Hive=9.0 to the uninstall, install, rollback and commit rows of the CustomActions table. Hope this helps somebody later..

  3. Miguel Madero says:

    Just to let ppl know there’s a community update of MCSF in http://www.codeplex.com/mobileblocks

  4. Miguel Madero says:

    There’s also a RC for the new OAC http://www.orientationaware.net/

  5. Petri Pehkonen says:

    Thanks for this. Hopefully you would change your mcsf future plans and upgrade  mcsf officially to vs2008 as it’s awesome factory to do mobile applications. We use it a lot.

  6. Tom Williams says:

    Hi All,  

    I am struggling trying to migrate this package to VS2008.  I have followed these instructions,  but when I am in VS2008 click on tools , ‘Guidance Package Manager’ Enable / Disable packages I cannot see the Mobile Client software factory??

    Any help would be gratefully received.

    regards

    Tom

  7. Brad Hehe says:

    I just did the 1st step to install the MSI but I am still hung up on getting past the GAT June 2006 version check. The installer insists on that specific version. And of course, I can’t find the download anywhere on MS site (they’re soooo notorious for this). I do have the GAX/GAT installs from both July 2007 and February 2008 (the Feb 2008 is registered for both VS2005 and VS2008).

    Can you please elaborate on how to get past this preliminary requirement check? Or where I can download the older version?  MS is bad about this notion that something more than 1-2 versions old couldn’t possibly be needed by anyone anywhere anymore… Grrrr… I’m betting if I get past that hang-up and follow these directions I’d be good to go.  We’re working on our 1st mobile app and wanted to make use of as much of the MCSF as possible – and I don’t see any current road-map/offering to steer me elsewhere….

  8. Riyaz says:

    The help on MCSF will not open. I get:

    Microsoft Document Explorer cannot be shown because the specified help collection ‘ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.mcsf.2006Jul’ is invalid.

  9. Great article. Let me add a quick update. We, at Clarius, have already published the Release version of OAC 2008 including full designer support for VS2008 as described before.

    If you’re interested, free download is available for community and trial editions in our site:

    http://www.orientationaware.net/

  10. nicolas lau says:

    Now, register the Guidance Package. (Without problems)——

    ———————————–

    how to register the Guidance Package?

    i have installed vs2005 and vs2008, after compile the Guidance package  project(using vs2008) to msi and install .msi,but only vs2005 has the Guidance of mobile cab application.

  11. tiago says:

    Since you’ve successfully managed to upgrade the package, why don’t you share it with the rest of the people ?