14

I am unable to build Windows Universal Apps in Visual Studio 2015. The application fails to start and shows this JIT debugger window:

Occurs immediately after launch There is a similair issue on StackOverflow that I cannot find but will continue to look for. One of the possible fixes was to switch to targeting 8.1 and then switch back, but I am unable to target 8.1 for any universal app. Debugging the program reveals the following details:

Exception thrown at 0x7523DAD8 (KernelBase.dll) in APP_NAME.exe: 0x04242420 (parameters: 0x31415927, 0x558B0000, 0x004FF1D0).

Unhandled exception at 0x00007FFF60BB1F28 (KernelBase.dll) in WWAHost.exe: 0x00000004: The system cannot open the file (parameters: 0xFFFFFFFF80004005, 0x0000000000000005).

WWAHost.exe has triggered a breakpoint.

I think it has something to do with the WinMD file (specifically this line)

<Error Condition="'$(_TargetPlatformMetadataPath)' == ''" Text="Could not find an existing platform WinMD location" />

But I'm not sure how to set the _TargetPlatformMetadataPath or anything like that or where it would be set.

Here is an image as well, as you can see the application fails to load entirely and displays a big X instead of any actual content: Application fails to load with a Win32/Kernel exception


Here's what I've tried:

  • Restart and Repair Visual Studio 2015
  • Remove, restart, reinstall Visual Studio 2015
  • System restore (uninstall apps and reinstall Windows 10)
  • Clean & Build Remove compile directories (bin)
  • Create a new project
  • Download a project/template
  • Enable Windows 10 Developer Mode
  • There is no nuget package config file

I can build other project types without any issue, it seems to only be an issue with Universal apps. I should also note, this issue occurs if the project is brand new or if I've added content to the apps UI. The designer also fails with System.Runtime.Remoting.RemotingException or a System.Runtime.InteropServices.COMException seemingly randomly.

I have not been able to find any truly similar issues anywhere. I can select Universal App as a project type, but if I click compile it fails no matter what. I'm at my wits end here and am open to any suggestions, thanks everyone.

Matt
  • 621
  • 1
  • 6
  • 24
  • Which Win10 Build and which VS2015 version do you use? For Win10 Ver1511 use VS2015 Update1 – magicandre1981 Mar 26 '16 at 07:36
  • @magicandre1981 It's Windows 10 (1511 Build 10586.164) and visual studio community 2015 14.0.24720.00 Update 1 – Matt Mar 27 '16 at 00:24
  • Does your application definitely target Windows 10, because this same error has been seen when trying to run Windows 8 apps on Windows 10 – Glen Thomas Mar 28 '16 at 18:39
  • @GlenThomas Yes it does, that was one of my earlier trials. I set the target through the project properties and manually by changing the project files after that failed. – Matt Mar 28 '16 at 19:18
  • Did you attempt to upgrade a win8 project to win10? – Glen Thomas Mar 28 '16 at 19:21
  • @GlenThomas No, this occurs with blank or downloaded projects. One app I was testing with can be found here [MicrosoftEdge/JsBrowser Windows 10 Sample](https://github.com/MicrosoftEdge/JSBrowser) – Matt Mar 28 '16 at 20:44
  • Why did you manually change project files? – Glen Thomas Mar 28 '16 at 20:47
  • @GlenThomas To ensure that projects I created were set to 10 and that the proper visual studio tools were being used (v14 not v12) etc. – Matt Mar 28 '16 at 20:48
  • What were they targeting before you edited them? – Glen Thomas Mar 28 '16 at 20:49
  • @GlenThomas All projects were targeting 10 with v14 tools, as they should have been – Matt Mar 28 '16 at 20:50
  • So when you said you "set the target through the project properties and manually by changing the project files after that failed.", you didn't actually do anything? – Glen Thomas Mar 28 '16 at 20:52
  • @GlenThomas I didn't technically change anything other than manually setting the version just to be 100% sure that I was targeting 10 since I've been going absolutely crazy over this. I'm fairly sure it has something to do with the enterprise beta I had installed prior to installing community... – Matt Mar 28 '16 at 20:54
  • Why do you suspect it has something to do with the WinMD file? – Glen Thomas Mar 28 '16 at 20:56
  • @GlenThomas Prior to my attempts at repairing visual studio I was receiving a compiler error along the lines of "Could not find the WinMD file for the Target Platform" – Matt Mar 28 '16 at 20:58
  • @GlenThomas [Gif of what is currently happening](https://i.gyazo.com/a9b8ace5c60de76d71fb84a05ca64257.gif) This is now how visual studio behaves, as you can see the build and deploy succeed but there is no debugging or anything – Matt Mar 28 '16 at 21:01
  • I can't run that JS browser application either and I get error "Could not copy the file "C:\Source\JSBrowser-master\Debug\NativeListener\NativeListener.winmd" because it was not found." – Glen Thomas Mar 28 '16 at 21:20
  • When I switch from AnyCPU to x64 it builds and runs fine – Glen Thomas Mar 28 '16 at 21:22
  • @GlenThomas Now you understand my problem! I received the same error, switched to x64 and then received the warnings you see in my above post. I then began taking steps to repair the visual studio install etc. and now get the latest "File not found" dialog you see in the gif – Matt Mar 28 '16 at 21:31
  • Can you run the [AdventureWorks.Shopper sample](https://github.com/PrismLibrary/Prism-Samples-Windows)? – Glen Thomas Mar 28 '16 at 21:31
  • @GlenThomas I cannot, I get the same "System could not find the file specified" I checked the activity log and saw the following: `System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.IntelliTrace.Package.Common.14.0.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.IntelliTrace.Package.Common.14.0.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'` Which might be causing the dialog to show? But I'm not sure why intellisense would break – Matt Mar 28 '16 at 21:38
  • When you run the application Visual Studio installs it to your Windows applications. Can you run it from the apps list without Visual Studio? Or CTRL-F5 to start without debugging – Glen Thomas Mar 28 '16 at 21:40
  • @GlenThomas Wow I hadn't thought to test that. Both apps launch but they close out almost instantly after launching, perhaps after the splash screen before any code is executed. – Matt Mar 28 '16 at 21:42
  • Can you try disabling Intellitrace [See guide](https://msdn.microsoft.com/en-us/library/dd264944.aspx) and run from Visual Studio? – Glen Thomas Mar 28 '16 at 21:47
  • @GlenThomas [Unfortunately](https://i.gyazo.com/da0b4b78223c32d14359774baa03bef5.png) it does not seem to load correctly. I will attempt to fix this first and get back to you. – Matt Mar 28 '16 at 21:54
  • It looks like Intellitrace is broken. I expect fixing that will fix your problems – Glen Thomas Mar 28 '16 at 21:57
  • @GlenThomas It appears intellitrace is unfixable... I attempted to clear the C:\Users\\AppData\Local\VisualStudio\14 folder as suggested, as well as doing devenv /setup and booting visual studio into safe mode. I also reinstalled Visual Studio entirely and still the package does not load correctly. I'm not sure what is happening here. I've never had this sort of problem before - I'm just glad I tried community before we switched to Enterprise :/ – Matt Mar 28 '16 at 23:28
  • As far as I know Intellitrace should not be available in VS Community [Compare Visual Studio 2015](https://www.visualstudio.com/en-us/products/compare-visual-studio-2015-products-vs.aspx). Apparently there was/is a [bug](http://stackoverflow.com/questions/25537040/how-possibly-did-intellitrace-become-available-on-my-visual-studio-professional) that causes it to appear when installing trials of other versions. Maybe installing Enterprise will fix it... – Glen Thomas Mar 29 '16 at 00:17
  • @GlenThomas Seems you were onto something with the enterprise thing - I can once again at least start debugging, but it still crashes with the wwahost error. Additionally the app still starts then closes when launching from outside of my development environment. BUT intelliTrace isn't a problem anymore so thank you for that! – Matt Mar 29 '16 at 03:18
  • I think you need to recreate your user profile. Can you test this by creating a new Windows user account on the same machine, log in as that user and try debugging your application? – Glen Thomas Apr 01 '16 at 21:21
  • @GlenThomas It was worth a shot but unfortunately no luck. Whatever is broken is broken machine-wide. I'm _fairly_ certain now it's a registry issue caused by the enterprise early release software. Also just wanted to say thanks for trying to help me with this, I really appreciate it. – Matt Apr 02 '16 at 02:25
  • Visual studio 2015 Update 2 was released on March 30, 2016. You may want to try installing it and see if that fixes your problems. – JamieSee Apr 04 '16 at 16:02
  • @JamieSee I was so hopeful but no such luck. Unfortunately I'm still getting the same old error and the same `The program '[10936] WWAHost.exe' has exited with code 0 (0x0).`junk I've been getting – Matt Apr 04 '16 at 18:24
  • Have you tried turning off you antivirus? It's a shot in the dark, but hey, stranger things have happened and this one isn't so strange once you think about it... Do it for the whole process (installation of VS included). Mocht want to try a different AV instead of turning it off though... – rubenvb Apr 08 '16 at 21:46
  • @rubenvb I actually don't run an antivirus other than windows defender on this machine but turning it off seems to have no impact. – Matt Apr 09 '16 at 23:42
  • Try opening one of Microsoft's sample UWP projects. Link to Github: https://github.com/Microsoft/Windows-universal-samples Link to ZIP: https://github.com/Microsoft/Windows-universal-samples/archive/master.zip Like it says in the readme, make sure you have Windows Software Development Kit (SDK) for Windows 10 (or maybe just start from scratch and follow the readme to get setup). – C. McCoy IV Apr 10 '16 at 02:14
  • @C.McCoyIV So I've taken a fair bit of time to test a really large sample of these programs and came up with the following results: any C# program would not compile at all until I reinstalled the `Microsoft.NETCore.UniversalWindows` package through nuget. After that I began getting the same errors I had been receiving previously. This goes for cpp, js, and c#. I have both windows 10 sdk's available so that doesn't seem to be the problem either... – Matt Apr 11 '16 at 03:38
  • After changing default save location in Settings - System - Storage from default C to another disk i have same exception. Take a look at [my submitted bug](https://connect.microsoft.com/VisualStudio/feedback/details/2558411/uwp-projects-couldnt-be-run-after-changing-storage-folder-in-settings) – Alexej Sommer Apr 12 '16 at 12:38
  • @AlexejSommer I am going to give this a shot, my default save location was actually a different (not C:\) drive so this seems promising! – Matt Apr 13 '16 at 13:17

1 Answers1

3

If nobody minds I'll post it like an answer (may be will be needed for someone else)

There was a bug in Windows 10 versions under Build 14295.

If you change default save location disk from C to another one in Settings - System - Storage - you will be not able to debug UWP apps in Visual Studio.

Upgrading system to latest should resolve the problem

Alexej Sommer
  • 2,677
  • 1
  • 14
  • 25
  • Don't know if this helps the asker but it fixed an issue I was having so +1. Thanks. – user5999614 Apr 13 '16 at 13:43
  • I just wanted to say I do see your answer. I am waiting on approval to go into the "insider program" before preceding but know that when I test it I will mark this as answered provided it works of course – Matt Apr 16 '16 at 06:03