Carl Patenaude Poulin Carl Patenaude Poulin - 3 months ago 32
TypeScript Question

How can I break inside a TypeScript UWP app in Visual Studio?

Minimal reproduction (in VS 15 Preview 2):


  1. Create a new project using the "JavaScript -> Windows -> Universal -> Blank App (Universal Windows)" template.

  2. Rename
    main.js
    to
    main.ts
    .

  3. Add a
    tsconfig.json
    file to your project (see here for why).

  4. Enter the following code in
    main.ts
    :

    declare var foo: any;
    foo();

  5. Go to "Debug -> Windows -> Exception Settings" and check "JavaScript Runtime Exceptions".

  6. Click the green "Run on Local Machine" button.



An error message appears:


Unable to activate Windows Store app [...]. The wwahost.exe process started, but the activation request failed with error 'Windows was unable to communicate with the target application. This usually indicates that the target application's process aborted. More information may be available in the Debug pane of the Output window (Debug->Window->Output)'.


Expected behavior: the IDE should break on
foo();
.

Answer

There is a work-around for VS 2015 Update 3 (s/o to @minestarks on GitHub):

I assume you're running in an English locale here, otherwise I don't think the workaround is applicable.

Close VS. In an administrator command prompt:

cd %ProgramFiles(x86)%\msbuild\microsoft\visualstudio\v14.0\typescript
mkdir en
copy *.xaml en
copy TypeScript.Tasks.dll en\TypeScript.Tasks.resources.dll

Now open your UWP project again, the TS files should be visible and building when you build your project.

Comments