It's not at all obvious right now how to:
A prepared template would be lovely for this.
Workaround for the debugging issues in VS 2015.2 and 2015.3 (s/o @minestarks):
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.dllNow open your UWP project again, the TS files should be visible and building when you build your project.
UWP projects are not currently supported for TS. we are working on enabling them, including type definitions, templates, and debugging.
UWP projects are not currently supported for TS.
Could you clarify that somewhere in the documentation?
we are working on enabling them, including type definitions, templates, and debugging.
Exciting news!
Do we have a time frame? I'm less bothered by full template support, but people have existing projects that were broken by Update 2/1.8.
TS works anyway on UWP when every compiled js file is added to project, while we have to build twice to run. Debug should just work, at least my projects do.
The bad thing is that TypeScript it worked perfectly with uwp/visual studio 2015 Update 1 and Typescript 1.7.6.
There was something broken after the update 2 of VS or the update of typescript (1.8>)
I have a very big UWP project that use TypeScript and I'm not able to upgrade VS or TypeScript because of to this issue ...
@lahloumehdi Does your problem also happen on VS2015 Update 3?
@SaschaNaz Unfortunately no.
@lahloumehdi so the issue is fixed in VS2015 Update 3? Great news!
By the way, last time I checked this was broken in VS15 Preview 2. Any idea if it was fixed at some point?
@lilred sorry I misspoke. The problem persists in the update 3 of VS cc @saschanaz
@lahloumehdi While we work on proper support for this scenario in Visual Studio 15, here is a workaround for VS 2015 Update 2 and 3 that I hope will restore the Update 1 behavior for you. The behavior you're seeing is potentially due to a TypeScript installation bug.
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.
Let me know how this works for you. I apologize for the trouble!
It works in VS 2015.3! Thank you @minestarks!
Unfortunately, I can't get it to work in VS 15 Preview 2.
I can also confirm it works great on Update 2! Thank you @minestarks!
@lilred Glad to hear! For VS 15, try running the same steps but replacing v14.0 with v15.0 in the folder path. Just tried it out with VS 15 Preview 3 and it worked for me, barring this other issue I noticed:
If you install VS 15 Preview 3 side by side with VS 2015 Update 3, the MSBuild task definitions may get corrupted (for both VS installations). If you start to see build errors referencing Microsoft.TypeScript.targets, back up and delete your %ProgramFiles(x86)%\msbuild\microsoft\visualstudio\ v14.0\typescript and v15.0\typescript folders, then from the Programs and Features UI in Windows, select Visual Studio 15 and repair it.
After you do this, you will need to re-run the original steps again to create the "en" directory so that your UWP/TS project works again.
Sorry for all the manual steps. We're working on making this a lot less painful in the next update.
@minestarks Thank you, thank you, thank you !!
By the way, what ambient type definition file do you suggest for UWP? Should I use winrt.d.ts? I installed it and found that it was missing some fields - for example the triggerDetails field of the Windows.UI.WebUI.WebUIBackgroundTaskInstance class.
@lilred I think there was also winrt-uwp.d.ts.
Yes, DefinitelyTyped is currently the best source for UWP type definitions. For VS15 we are working on generating these definitions automatically for your project, which should provide better support for changing APIs and third party libraries.
Oh ! That is an awsome feature ! VS15 (will) rocks
Le 12 juil. 2016 23:44, "Mine Yalcinalp Starks" [email protected]
a écrit :
Yes, DefinitelyTyped is currently the best source for UWP type
definitions. For VS15 we are working on generating these definitions
automatically for your project, which should provide better support for
changing APIs and third party libraries.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/TypeScript/issues/8950#issuecomment-232191161,
or mute the thread
https://github.com/notifications/unsubscribe/AIaVSUK6AHUt24vJONuV1Q5giS3rdw-Qks5qVArDgaJpZM4ItINi
.
FYI: the most recent update vs14-kb3165756 appears to undo the workaround. I had to do it again.
Uunfortunately the last update of VS2015 breaks undo the workaround :( @minestarks
(The TS files are visible, the JS files are loaded when I run the app, but the debugger doesn't work with TS files...)
Installing VS15 side by side with VS2015U3 does not display .ts files and does not let me deploy UWP apps. The tip didn't work as repairing didn't restore v15.0/typescript folder. Copy-pasting from v14.0/typescript made .ts files visible but I still cannot deploy UWP apps.
PS: Deploying issue was because I had to install SDKs also side-by-side.
I've found that VS15 Preview 5 gives us WinRT type definitions with a file name winrtrefs.d.ts :D
@SaschaNaz yup - in Preview 5, types from the Windows API and any other WinRT references should automatically be included in your TS build and Intellisense context. Go ahead and try it out and please file issues :)
Hello,
My project is developed in TYPESCRIPT.
How can I distinguish an application is website or is UWP App in runtime?
Because I want to use different UI between website and UWP.
Thanks.
@IngoChou Try let isUWP = typeof Windows !== "undefined".
@SaschaNaz
Thank you very much. It works well.
Most helpful comment
UWP projects are not currently supported for TS. we are working on enabling them, including type definitions, templates, and debugging.