1
votes

I just built one of the project templates Visual Studio 2012 offers (the 'Split App (XAML)' template accessible via Templates -> Other Languages -> Visual C# -> Windows Store in the 'New Project' dialog).

I can execute the application from Visual Studio 2012, and I can launch it from the Windows 8 start screen - but if I attempt to launch the generated executable directly (e.g. via the Windows explorer or from a command shell), a full-screen error message is printed saying "This app can't run on your PC".

Looking at a running instance of the application via Process Explorer shows that it a) just links against the .NET runtime MSCOREE.DLL and b) it gets invoked with a command line like this:

"[..] \bin\Debug\AppX\WindowsStoreSample.exe" -ServerName:App.AppXgsxd2athqtr03f55we0938hcn632we3k.mca

My actual question is: what's the correct way to launch this kind of application programmatically? Would I use plain CreateProcess and then try to assemble a command line like shown above? If so, how could I determine the correct -ServerName argument? Or is there some other way to launch such applications?

1
If anybody knows the proper term for these 'full screen' applications which were introduced with Windows 8, please let me know so that I can update the title of the question accordingly.Frerich Raabe
You mean Metro Application?Adam
@AdamTester: I think so, yes. The ones which run full-screen and use the new tiled GUI.Frerich Raabe
Yah they are call Metro appsAdam
They are not called Metro apps.sasha.sochka

1 Answers

3
votes

The correct way to launch Windows Store apps is to use the IApplicationActivationManager interface. This is also what Visual Studio itself uses for launching the application. All methods on the interface have a DWORD out parameter which gets you the PID of the newly launched process.