Launching TaskHost.exe failed, trying to run Windows Phone 8 app? - windows-phone-8

My VS 2013 setup has been humming along fine for months now. Today I tried to update to Visual Studio 2013 Update 2 RC. Just like last time when I updated to Update 1, setup failed badly with a huge list of packages marked with the "Incorrect Hash Value" error. Unfortunately MS does not have an ISO yet for Update 2 so I can't take that route to complete the update like I did last time. Now I can't run apps on the Windows Phone emulator or on the phone (device) anymore.
I believe that the failed update caused my current deployment problems since the problem surfaced right afterwards. It could be due to some other NuGet package or Extension, but the update is the most likely cause due to the timing of events.
I did extensive reading on SO and tried all the noted solutions. None of them worked:
cleaned and rebuilt the test Windows Phone 8 project (multiple times)
restarted VS2013
rebooted
Exited VS 2013 and restarted it with the Emulator left open (for the Emulator test)
repaired the Windows Phone Emulator install
repaired the VS2013 install
Nothing works. After the IDE installs the app on to the emulator, I still an error dialog box saying:
"The application could not be launched for debugging. Ensure that the target device screen is unlocked and that the application is installed."
And in the VS2013 IDE status line I see the message: "Launching TaskHost.exe failed".
Does anyone know how to fix this? Note, I tried several WP8 projects that I know worked successfully before and none of them can deploy successfully anymore to either the Emulator or the Device.

I see this was asked a month ago, but I had this issue as well. If I left the Emulator running and tried launching it again, I would have TaskHost fail with a different error.
The following was what made it work for me.
Under the following:
Solution(Right-click) > Properties > Configuration Properties > Configuration
Ensure that your main project is set to 'Deploy.'

Have many reason to error.! So, If you doing with database such as SQLLite file or SQL compact file for your project WP, you should check it is used anywhere. Or choose Embed source copy in visual. That's my fail.And i fixed ok!

Did you try from the menus?
BUILD > Rebuild Solution
That worked for me just now.

Related

VS 2015 RTM Deploying or creating packages for 8.1 Universal app fails

I have VS 2015 RTM on Windows 10 RTM, suddenly (maybe an update) is causing today that any project 8.1 Universal can't be deployed anymore, not emulator, not device. I have confirmed it happens with any new project or existing one.
This does not happen with 8.1 Silverlight projects! which is even more strange. I have reinstalled VS 2015 and the latest cumulative Windows Update for IE and the problem persists.
EDIT: It also happens when trying to create app packages for the project but this time crashes VS!
Have any one came into this lately? Any ideas?
UPDATE: I get - An unhandled exception of type 'System.Reflection.ReflectionTypeLoadException' occurred in WindowsBase.dll
when debugging the crash when creating packages, but can't find more information
I've found that VS2015 hides some errors (not sure why or how). When it happens, try open VS2013 (if that is an option for you) and build there. It'll correctly tell you what the error is, and once you fix it you can return to 2015.
Got it! I uninstalled the Apache Cordova tools and the problem is gone magically, don't know what conflict may these tools cause with the 8.1 SDK but sure has to be investigated.

Windows (phone) emulator 8.1/10 stuck at loading the OS

I've been trying to get the emulator to work for days. Previously I tried the Windows Phone 8.1 Emulator as well as the Windows 8.1 Simulator and both were stuck at loading the OS.
Earlier today I installed the new Windows 10 Tools and thought I should give it another try with the new Windows 10 Emulator... And no, still the same result.
What's strange is that, the Hyper-V Manager seems to be doing OK. I can see the app displays correctly on the little Preview window (see the box on the left side of the picture below).
Also, breakpoints are hit, the project seems to be running OK.
As many answers have already suggested, I tried letting it running for an hour, but still nothing came up.
Things that I've also tried include uninstalling all the Virtual Machines as well as repairing the WP 8.1 Emulator, nothing has worked so far.
Please help, this has driven me completely insane. :(
Update
Not sure if this would help, but if I change the Windows Phone Emulator Internal Switch to use Private network instead of Internal, I will get a couple of warnings saying Unable to determine the Host IP address and then the Emulator will show up with the Emergency Call screen. Not much I can do from there as the three buttons on the bottom are not functioning at all.
I understand that changing the connection type is not the right way to do it, but this at least tells me that the Emulator can work, it's just a matter of how.
I believe you have two Windows Phone Internal Switch connections and one seems to be unplugged while the other is running. Disable the one that is unplugged and leave the latter. This worked for me after 2days of tinkering. God speed.
Try the following.
Open the Hyper-V Manager
In the Actions pane, click Hyper-V Settings
In the Server pane, select Physical GPUs
Uncheck, Use this GPU with RemoteFX
Click OK to save/close.
Attempt to start the Windows Phone emulator VM from within Hyper-V Manager or Visual Studio.
I solved this problem by simply adding XDE.EXE as an exception to my Windows Firewall.
Just today
Many times it is not stuck. It just does take too long to start. I have an 8 core processor and it took like 5 minutes to launch, I tought it was stuck but it did launch.
Not sure if this would help, but if I change the Windows Phone
Emulator Internal Switch to use Private network instead of Internal, I
will get a couple of warnings saying Unable to determine the Host IP
address and then the Emulator will show up with the Emergency Call
screen. Not much I can do from there as the three buttons on the
bottom are not functioning at all.
when you set it to private network, Windows can't interact with your WP Emulator. Open Network Adapter, and try disable and try start emulator again, then enable again this adapter if it is not work *
I contacted the Visual Studio Team a couple of weeks ago and looks like they have fixed this issue in the latest update. And here is how I finally got it all working.
Update your Windows 10 TP to the latest version (currently 10074).
Install the latest Visual Studio 2015 (currently RC).
Install Windows 10 developer tools preview from here (I got
some weird errors with Error code: -2147023294. Ignore them, go
straight to the next step).
Install the standalone Windows SDK for Windows 10 Insider
Preview from here.
Install the Pre-release Microsoft Emulator for Windows 10 Mobile
from here.
That's all! After all these are done, both my Simulator and Emulator are loading up fine.
In my case, deleting the internal switch from Hyper-V virtual switch manager helps, whenever you run your app using emulator as the target, it'll add a new internal switch by itself and the emulator will run normally (no longer stuck on loading screen)
The problem is, I have to do it every single time I restart my PC
The workaround steps to install the Windows SDK and Emulator are no longer needed.
We have released a fix as of 7PM PDT 30 April 2015 for the setup error
Windows 10 SDK 10.0.10069 : The installer failed.
User cancelled installation. Error code: -2147023294"
New setups should no longer encounter this issue.
For existing installations, and for more information, see this forum post:
https://social.msdn.microsoft.com/Forums/en-US/17bc9d5e-2ea7-4149-bb75-23997db8bd25/
This worked for me:
Go to Windows Defender.
Add exclusion following path: "C:\Users\UserName\AppData\Local\Microsoft\XDE\YourEmulatorVersion"
YourEmulatorVersion - for example 10.0.14393.9
2 days, tried all that is posted here but nothing worked! Finally, since it is a lot easier nowadays to (re)install windows without loosing your files (3 hours including updates), I just resorted to that. Same thing happened, but then I saw the alert that I had not yet activated my VS to run in developer mode :) Did that, and voila, the emulator now works.
If this might be helpful: my problem started when I installed Android Studio and disabled Hyper-V from Android. Enabling it back for VS just couldn't get me to run it again. But I hear there is a way to run both Android & VS emulators using VS emulator for Android. I will try to see how that works later...
I know the question is old, but none of the above answers worked for me so I write down my two cents:
Go to Hyper-V console and remove all emulators
Go to Devices Management, under network adapters tree node, delete all virtual switches
Run an emulator from Visual Studio and see the magic happen

Windows phone 8.1 emulator not loading OS

I am trying to launch the emulator (Emulator 8.1 WVGA 4 inch 512 MB, or any other as a matter of fact) but it fails to launch.
It goes to the "Loading OS" screen then throws an error box with the text "DEP6100". On VS, it says at the bottom
Error1 Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device': ObjectDisposedException - 0x80131622
and
Error2 Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device': ObjectDisposedException - 0x80131622
Looked in the internet but haven't found an answer yet. Can you please help?
Please let me know what additional information you need.
I had the same problem on a fresh install of Windows 8.1 and Visual Studio 2013 Update 3.
Firstly, I went through all of the Microsoft requirements and suggested steps for problems found on MSDN here:
Windows Phone Emulator for Windows Phone 8
After confirming that I met the requirements and none of the possible fix suggestions fixed my problem, I tried the following, which fixed the errors I was getting with the emulator.
I fixed the problem by:
Closing Visual Studio
Going to the "Control Panel"
Selecting "Programs and Features"
Find "Windows Phone 8.1 Emulators - ENU" in the list
Click the "Change" button at the top or right-click and select "Change"
On the "Visual Studio" window that appears; select "Repair"
Wait for the process to complete, and re-open Visual Studio
Run the emulator again and it works this time!
You may have to restart your PC if you left Visual Studio open in order for the changes to take effect. Good luck!
I had same problem . first i fixed it with:
Updating windows
Uninstall / install Windows Phone SDK 8
Remove and add Hyper-v again ( maybe it is not necessary )
But problem came back and instead of previous solution i fixed the issue with :
going to windows firewall and then click on "restore defaults"
Installing McAfee seemed to block out my emulator... I uninstalled it and restored default firewall settings and it's working for now...
Make sure your processor supports the necessary requirements for running the emulators. After a few hours of trying I finally checked on...and the processor I have doesn't support at least one of the requirements.
Run coreinfo -v - available here - you're looking for an * next to EPT (on Intel) or NPT (on AMD). If it shows a - then you need a different processor. Good luck!
For Windows 10 Emulators 10.0.1.0 (1081p 2gb)
You should Delete all (VHD and AVHD) files in:
C:\Users\MyUserName\AppData\Local\Microsoft\XDE\10.0.1.0\
All will be recreated when the emulator wil restart. Replace MyUserName by you user name.
Should work for other emulator.
See you :)
I had your same problem and after many attempts resolved it this way:
Deactivate Hyper-V (and restart computer);
Go in the Device Manager and open the Network Adapters, here uninstall everything with the name "Hyper-V...", this will allow us to reactivate Hyper-V without any conflict;
Enable Hyper-V (and restart computer);
Finally launch the emulator (if it is the first time you launch it you will have to wait 5-10 minutes, so be patient and wait for it to load all apps it need).

Issue packaging a Windows Phone 8 app

I just installed Visual Studio 2013 on my machine (which runs Windows 8.1 Enterprise Build 9600). I checked to include the Windows Phone 8 SDK option during install.
Once complete, I launched VS and tried a new Windows Phone App project.
Created and built fine. However. when I tried to run on the emulator, I get the error:
Xap packaging failed. Cannot access a closed Stream.
... and ...
Could not find file 'c:\users\wade\documents\visual studio 2013\Projects\DataBoundApp1\DataBoundApp1\obj\Debug\XapCacheFile.xml'. Please rebuild the solution and try again.
Tried a clean and rebuild but still occurs. Also happens with the data bound app project.
So, I tried installing some of the SDK updates found here: http://developer.windowsphone.com/en-us/downloadsdk. All installed without a problem; however, when I tried again I got the same error.
Note: the emulator starts and runs just fine. The problem is creating the phone package and deploying to the emulator.
I'm not sure how to fix. Anyone have this issue?
UPDATE:
I have tried reinstalling the Windows Phone 8.0 SDK and all the updates. I should note that I also have VS 2012 installed and I also cannot create a Windows Phone 8 app in VS2012.
Here's an image of the WP8 stuff installed:
I resolved this issue by downloading the full Windows Phone 8.0 SDK ISO and installing (followed by a repair on the two updates).
I wish I could better explain how my machine got into this state. My suspicion is it's because I already had VS2012 installed on the machine and VS got into a confused state.
Total time spent? 4-5 hours.

Windows Phone Emulator Application Development Error

I am encountering an error on my emulator.
I've been developing an application for windows phone, it used to run okay and there was no error.
Recently, i upgraded my visual studio, now my project cannot be loaded. So I tried reinstalling my visual studio.
After reinstalling, an Application Development Error occured. I've looked for a solution but have been unable to find one.
During my search, I found out that my emulator didn't work properly. It was starting up, but after 13 seconds it reboots again and starts up again, this loop keeps going for several minutes. After that my visual studio gives me an error.
This led me to believe that the error was caused by a virtual hard disk issue, so I choose the virtual hard disk from MicrosoftSDKs/Windows Phone/Emulation/Images/Flash.VHD and it is running now.
But after I configure my settings of the emulator to change its virtual hard disk to Flash.VHD, It doesn't work at all. It keeps restarting over and over again.
I have been trying to solve this error for 4 days.