Subscribe to the RSS feed then follow me on twitter at @mrlacey

Tuesday, November 27, 2012

An undocumented way of creating a xap file you can't deploy to a #wp8 device

"Deployment failed" it's not a message you want to see when deploying your app to a device. Especially if you've previously deployed to the emulator without issue.

Even more worrying is this message:
"Deployment optimization failed due to an invalid assembly. Rebuild your source projects and try again."
Especially worrying after rebuilding several times.

A little googling for that message turns up the fact that this is also the error message displayed when trying to use the, now removed, WP8 version of the ReactiveExtensions but not a lot else. (As referenced at  and reported

It turns out that this was a result of an issue caused by a workaround after moving to TFS in the cloud.

Before moving to the cloud we had a powershell script which would rename the XAP file to include the version number of the main assembly. (This is invaluable during testing when you want to know you're installing the right version.)
Unfortunately this didn't work on the server.
Plan B was to use a simple command line app to rename the XAP instead.(It seems you can run [console] apps on the build server - but presumably with very little functionality actually available.)
To ensure that the exe was in the appropriate output directory I added it the project, set it's build action to None and set it to always copy to the output directory. This was the problem. The WP8 (this problem didn't happen in the WP7 version) compiler was seeing that there was an EXE in the project and doing something different with the final XAP.

Fortunately, this was resolved by adding the EXE to the solution directory and then referring to it from there without adding it to the project. The after build event still knows where everything is and all is good.

TL;DR/Lesson: Don't include desktop EXEs in your WP8 project, even if they're not included in the XAP.
And be sure to always test on actual devices, not just the emulator. It is possible for apps to run in the emulator and not even load on an actual device.

If you've built Windows Phone or Windows Store apps you can cross-promote them with AdDuplex to get more users.


  1. "And be sure to always test on actual devices, not just the emulator. It is possible for apps to run in the emulator and not even load on an actual device."

    Good advice, yet this seems to break the whole "emulator" thing, since it seems that it doesn't properly emulate a physical device!

  2. The best replicas can butt even those who are abreast about the brand.If you wish to replica watches uk be abiding you are affairs the absolute thing,accomplish your acquirement from a acclaimed banker who is listed on the Rolex website.If you're blockage out a acclimated archetypal or eying a friend's,there are signs you can attending for to advice you atom a fake.Fake Citizen watches accept cartier replica abounding the watch bazaar alone in the accomplished 5 years,although the budgetary accumulation of affairs a affected Citizen over the 18-carat alarm is minimal.Spotting affected Citizens is difficult because the affected versions generally affection the aforementioned apparatus as the 18-carat article,but they are gucci replica fabricated with cheaper offers accomplished superior replica accoutrements and handbags for all occasions.The abundance houses some of the a lot of accepted replica articles including replica chanel bags,replica gucci bags,replica handbags,replica drillmaster handbags,louis vuitton replica handbags hublot replica replica louis vuitton handbags,drillmaster replica handbags,replica chanel handbags,artist accoutrements and a lot more.You are aswell acceptable to acquisition all the qualities of accomplished handbags in the replica bags,which are offered by this store.The abundance aswell prides on affairs replica accoutrements that are louis vuitton replica fabricated from the aforementioned actual as the accurate handbags,which is cowhide covering and assumption hardware.

  3. grew up in the 1800's and was amidst by French ability which he acclimated to replica watches
    his advantage to accomplish and architecture appearance accessories for the wealthy.The cast name and near accomplishment of louis vuitton replica his superior craftsmenship was accepted and accepted by his flush and affluent account of clientele.So, this hasn't changed, even down until today. The operation is getting run by Daniel Lalund, the admiral and CEO of
    North America division. Does Louis Vuitton Go On Sale? This catechism would never be asked by the flush and affluent. As a amount of fact, if these luxury, artist handbags were too bargain it would not address to breitling replica them and they would abode a lower amount on these items.Wealthy humans for the a lot of allotment enjoy cogent others how rolex replica abundant they've spent on affluence items because it makes them feel good,important and rich.Okay, I'll stop acrimonious on the flush or affluent. lol. Seriously, we accept been in a affectionate of recession for the accomplished brace of years and I can candidly say, I accept not noticed a drop in omega replica the amount of LV's accepted archive to date.According to Daniel Lalund, With that said, it could be safe to accept the affluence banker will not accept any sales or bead in they're retail abundance prices or online catalog. So, if you absolutely will not
    the best, I assumption you'll accept to pay for it.

  4. chicago bears,
    nobis outlet,
    tory burch shoes,
    replica watches,
    ed hardy shoes,ed hardy,ed hardy clothing,ed hardy shoes for women,ed hardy clothing for men,ed hardy perfume,ed hardy watches
    christian louboutin,
    ugg outlet store,
    nike huarache,
    nike air max,
    ray ban,
    louis vuitton bags on sale,
    nike air max,nike roshe,nike huarache
    canada goose outlet,
    hermes belt for men,
    north face jackets,
    ray ban sunglasses,ray ban sunglasses outlet,ray ban,rayban,ray bans,ray ban outlet,ray-ban,raybans,ray ban wayfarer,ray-ban sunglasses,,rayban sunglasses,cheap ray ban
    cheap oakley sunglasses,
    woolrich clothing,
    kkkk10 13