Custom build/deploy for Metro style C++ apps RRS feed

  • Question

  • I'm updating a legacy C++ project for WinRT. The project uses a custom build tool that invokes VS's command line compiler and linker. I'm able to get the project compiling and linking (by adding the /ZW compiler option and changing dependencies) but the application crashes immediately on startup accessing COM components (ApplicationModel::Package::Current, for example). I'm actually able to get the project to run correctly by creating a second, empty project using the Metro style C++ templates, overwriting the output executable of the default Metro style C++ app, and debugging that default app without rebuilding. This results in the executable from the legacy app being copied into an AppX folder. Is there any way I can replicate this behavior without a second, empty project? It looks there's something special about Metro style C++ project. A vs.apprecipe is created, and it looks like this defines the layout of the AppX folder. Apparently Add-AppxPackage Register allows you to run an unpackaged app, but this didn't resolve my issue.
    Tuesday, August 14, 2012 11:47 PM

All replies

  • I was able to get this working by manually creating the AppX folder and using Add-AppxPackage -Register to register an unpackaged app and launching the app with ActivateApplication. This works fine, but I'd like to be able to debug the app without manually attaching. Any ideas for what I can do to replicate F5 debugging? My current approach is to create a VS extension, but if there's some way to more directly replicate what VS does under the hood for Metro projects, I'd prefer to do that.
    Wednesday, August 15, 2012 8:03 PM
  • Look here.
    • Edited by Martín.Ib Friday, September 28, 2012 11:41 AM
    Friday, September 28, 2012 11:35 AM