I’ve just come across this error when trying to launch my WP7 app for debugging on the emulator.
“The application could not be launched for debugging. Ensure that the target device screen is unlocked and that the application is installed”
The thing is that everything was working fine last night, and this morning I started getting this error when I press F5 to launch the app. Usually you see this error when debugging on hardware when the physical device’s screen is locked. But this is on the emulator which doesn’t have a screen lock! So what gives?
Well the error message does say to check that the application is installed and sure enough when I checked the emulator the app was no where to be found.
But I was pressing F5 and launching the app from Visual Studio. Isn’t that supposed to boot the emulator and deploy the app to it?
Actually yes it does…but only if it is configured to do so in the solution settings. Checking the solution properties for shows the problem.
(Blurs = NDA)
My main application project wasn’t set to build or deploy to the phone for the “Debug” configuration (or “Release” for that matter). So checking these two boxes so that it does build and deploy solves the problem.
That does leave the question, how did they become unchecked in the first place? It was all working fine when I left it yesterday.
I’m not sure what causes it but this is not the first time I have seen the configuration spontaneously change like this. All I can say is that it seems to have started after I added some non-Windows Phone projects to the solution. In this case I have a console app for building some binary data files that the app uses.
I don’t think that the problem is the x86 projects themselves but rather the fact that I have an extra build configuration. I have a “Console App” configuration, in addition to “Debug” and “Release” which I can use for just debugging the console app (When I’m debugging the console app I don’t want to deploy or build the WP7 projects).
And that seems to be the source of the problem.
Something is mixing up the settings from the “Console App” configuration and overwriting the “Debug” settings. If I had to I would point the finger at Expression Blend. Blend does not support build configurations and I have had many problems getting Blend to build and run the solution ever since I added the “Console App” configuration.
The smoking gun was that last night, for the first time in a while I was working in Blend and deploying apps from there directly (usually I always deploy from Visual Studio).