Migrating a Metro app from Beta to Release Preview

There were a few breaking changes to Metro apps when the Visual Studio 2012 Release Candidate came out. To develop for the latest version of Metro sing our tools, you will need the June 2012 Release or newer, which you can get from the usual places, including our licensed downloads page and as trial version.

Once you have the June Release or a newer beta installed, you are ready to build Metro apps for the Visual Studio 2012 Release Candidate and Windows 8 Preview, but if you started working with the Consumer Preview of VS11, you’ll need to make the following changes:

  • Remove public from your XAML Pages and App partial classes – You will get an error like ‘(E57) The type visibility for “app” does not match other class parts.’ Simply remove the public visibility modifier from the declaration in the interface section of your pas files. So instead of “type app = public partial class” it should say “type app = partial class”.
  • Add a default language – You may get a warning like “(APPX1901) The DefaultLanguage property is either missing from the project file or does not have a value. The fallback language is set to the Visual Studio language: en-US.” You will need to open the .oxygene project file in your favorite text editor and add the line en-US in the first . The warning will then be removed.
  • Recreate your certificate – Anytime you move a project from one machine to another you may find you need to recreate your certificate. You will know because you get a warning like “(APPX0107) The certificate specified is not valid for signing.” The fix is simple:

  • Just find the XXX_TemporaryKey.pfx file in your solution (where XXX is the name of your project) and remove it.
    TemporaryKey in Solution Explorer

  • If you try to build now, you will get the warning “(APPX0104) Certificate file ‘XXX_TemporaryKey.pfx’ not found.” You need to create a new certificate: Double-click your Package.appxmanifest file in the solution explorer. From there, go to the Packaging tab.
    Package.appxmanifest Packaging tab
  • Click the Choose Certificate… button. From the Choose Certificate dialog, click the Configure Certificate drop down, and select *Create test certificate…
    *
    Choose Certificate
  • Then, on the Create Test Certificate dialog, you can provide a Publisher ID or just click OK. Now you will have a new “XXX_TemporaryKey.pfx” file and the warning will go away.
  • The Metro Style Apps Dev Center has more information about valid certificates.

There were a few other changes, but those will vary from app to app, depending on what you’ve done in the app. I’ve updated my MetroExamples to work with the latest Release Preview and the June Release.

jim

0