I am creating a Microsoft Band app that uses the new custom page layouts. I am using Microsoft Visual Studio Community 2013 update 4. I have everything working properly and the app works great on my test environment (i.e. when I push the app from my computer to my phone). However, once I create the store build and create a beta app package and download it from the store and try to install the Band tile via the app I get an Exception. I repeat, I do not get an exception when I install the Band tile via the app, when the app is pushed from my dev environment, but I do when the same code is used to create an app package and the process repeated, but with the newly downloaded binary.
The Band tile is successfully added to my band, but my band app only has the first of the 5 custom page layouts that I try to add. I know this after much trial and error (dozens of beta app packages uploaded to the App Store).
I have solicited other beta testers and they all receive the same exception.
Here are the Exception details
Microsoft.Band.BandIOException:
Exception of type 'System.Resources.MissingManifestResourceException' was thrown. ---> System.Resources.MissingManifestResourceException:
Exception of type 'System.Resources.MissingManifestResourceException' was thrown.
at
System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at
Microsoft.Band.BandResources.get_CommandStatusError()
at
Microsoft.Band.BandClient.CheckStatus(CargoStatus status, CommandStatusHandling statusHandling)
at
Microsoft.Band.BandClient.DynamicPageLayoutSetLayout(Guid appId, UInt32 layoutIndex, PageLayout layout)
--- End of inner exception stack trace ---
at
Microsoft.Band.BandClient.DynamicPageLayoutSetLayout(Guid appId, UInt32 layoutIndex, PageLayout layout)
at
Microsoft.Band.BandClient.AddTileOutsideSync(BandTile tile)
at
Microsoft.Band.BandClient.<>c__DisplayClass9b.<AddTile>b__9a()
at
Microsoft.Band.BandClient.RunUsingSynchronizedFirmwareUI(Action insideSync, Action afterSync)
at
Microsoft.Band.BandClient.AddTile(BandTile tile, Guid applicationId, IReadOnlyList`1 installedTiles)
at
Microsoft.Band.BandClient.<>c__DisplayClass6f.<<AddTileAsync>b_6c>d__71.MoveNext()
-- End of stack tracke from previous location where exception was thrown ---
After much all the trial and error I have simplified the problem to the following code. It produces the error when the binary is retrieved from the App Store and the method is executed. However, it doesn't produce any errors when the binary is pushed from my local computer via Microsoft Visual Studio 2013 Environment and the method is executed. Additionally, if I remove the line that adds the custom page layout and send my app through the store and test, there is no exception thrown.
public async Task CreateBandTile() {
try
{
Guid tileId = new Guid("2D3A78E2-84BB-4E56-AFEB-B160B2433E20");
IBandInfo[] pairedBands = await BandClientManager.Instance.GetBandsAsync();
IBandClient bandClient = await BandClientManager.Instance.ConnectAsync(pairedBands[0]);
BandTile myTile = new BandTile(tileId)
{
Name = "My Band Tile",
TileIcon = await LoadIcon("ms-appx:///Assets/IconLarge.png"),
SmallIcon = await LoadIcon("ms-appx:///Assets/IconSmall.png"),
IsBadgingEnabled = false
};
FlowPanel page = new FlowPanel(
new TextBlock()
{
ElementId = 1,
Rect = new PageRect(0, 0, 100, 30),
Font = TextBlockFont.Small
}
)
{
Rect = new PageRect(0, 0, 245, 30)
};
// *** If I remove the following line, no exception is thrown ***
myTile.PageLayouts.Add(new PageLayout(page));
// Remove the Tile from the Band, if present.
await bandClient.TileManager.RemoveTileAsync(tileId);
// Create the Tile on the Band.
await bandClient.TileManager.AddTileAsync(myTile);
}
catch (Exception)
{
throw;
}
}
What am I doing wrong here? Maybe I am the first developer to send an app through the MS app store that uses custom layouts. I feel like there is a bug here that is on Microsoft's end.
The bug has been resolved with the release of the new Microsoft Band SDK.