VS 2013 Community Add new Typescript file missing - visual-studio-2013

Downloaded and Installed Typescript 1.4 from typescript page into VS 2013 Community Den Update 4.
Following install (no error messages), I tried to add a new typescript file. I expected to see such an option in the righ-click menu on "ADD new". Cannot find any reference to typescript files anywhere in any of my projects.
I can manually create a file and give it a ts extension in the "Scripts" directory of my project. However, there is no intellisense and no indication that a "shadow" js file has been created.
I'm at a loss as to how to get typescript working in VS 2013 Community Edition

I think I found the problem.
To use typescript in conjunction with an existing project in Visual Studio, I had to add a new project (using the typescript template) to the solution containing my existing project. Then, I could add new typescript files to the typescript project.
The generated javascript files in the TypeScript project could then be made available to the pages in the existing (co-)project by selecting the "Output to Folder" option on the Typescript project, specifying the scripts folder in the other project.

Related

Visual Studio Installer Project Content File References to new VS2017 Project do not work

For legacy reasons we still use the Microsoft Visual Studio Installer Project Extension.
In the setup project there is an project output added of type content files that points to a library project.
Via this output 3rd party stuff is included into the setup.
After migrating the library project to the new VS2017 format, the content files are empty and aren't included into the setup anymore.
Visual Studio is 2017, newest update and the installer project extension is up to date as well.
Any ideas on how to get this working?
I converted the project back to the old project format and it works again. But as the old format doesn't display NuGet references nicely, it would be cool to being able to update to the VS2017 format.

Type Script is not generating JavaScript in my Visual Studio Community edition 2015

I am using Visual Studio Community edition 2015 for development, I have added *.ts file to my project but its not automatically compiling. Also it does not show JavaScript preview pane. This post How do I enable the preview panel for TypeScript files in Visual Studio 2015? says that it's not supported anymore. That's fine, but why it's not compiling?
I referenced Missing Typescript Options in Web Essential for Visual Studio 2012
It says Split panes have been reintroduced in the latest version of web essentials http://vswebessentials.com/features/typescript but I can not see it
I do have typescript exe in following folder
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.5
I do have settings in Project Properties as follow
I do have settings as follow in Visual Studio
I see comment in http://www.typescriptlang.org/ as below
"Visual Studio includes TypeScript in the box, starting with Visual Studio 2013 Update 2. You can also edit TypeScript in VS Code, WebStorm, Atom, Sublime Text, and Eclipse"
What may be issue?
Solution
My "typings" file for jquery was out dated, I upgraded it and it resolved other errors and build was success, then JS files got generated.
Below post helped
JQuery definition screwed up with TypeScript 0.9
I can not close this question because I am still not able to get 'Preview Pane"
I regularly encounter this issue in VS 2015 and VS 2013. My solution is not a pretty one, but it works for me...
Close Visual Studio
Go to your scripts folder, delete all JavaScript files that have corresponding TypeScript files (only necessary to do this for TypeScript files that you have created for your project)
Open Visual Studio, clean, and build
If this doesn't work, open each TypeScript file, change one character, Save, re-build... hopefully the file will re-compile.
If this still doesn't work, open a Node.JS command prompt, change directory to the scripts directory, run;
tsc "yourfile.ts"
If this doesn't work, you've got bigger problems.
Make sure that you highlight the project in the solution explorer and then click the icon at the top that says "show all files" after you have compiled the project. You will then see the .js and maybe a .js.map file (greyed out). Select the files and then right click and 'include in project' and things should be good from there.
Some false-errors in my ts caused the issue, fixed by uncheck "Do not emit outputs if any errors are reported"
(The false error is from an outdated DefinitelyTyped file, the generated js file does not have any error.)
Maybe not having the option to expand the .ts file and see the generated .js can cause a confusion here.Try to compile your solution. Click on Show All Files and you must see all the .js generated in the same folder of your .ts files. Include your .js in the project if you want to have them visible as part of the solutions. Hope this helps
I know you say you added the .ts file but did you right-click and select 'include in project'. This will add it to the list of files that Visual Studio will check for TypeScript transpiling.
You need install Web Essential then restart the Visual studio -> clean Solution -> Rebuild it should work.

VS2013 not adding Javascript generated from Typescript to project automatically

I'm using TypeScript for the first time. I'm using Visual Studio 2013 with update 4, Web Essentials with update 4, and have the latest version of TypeScript from Microsoft's website. However, following the tutorial doesn't work for me: when saving a TS file, it automatically compiles to JavaScript on the screen to the right of the code I typed, and a JS file is created in the folder. However, this file is not added to the project automatically. How can I set Visual Studio 2013 to automatically add generated JS files to the project?
How can I set Visual Studio 2013 to automatically add generated JS files to the project
Use a glob for your TypeScript folder i.e. modify your .csproj file to include:
<Content Include="client-src\**\*.*">
</Content>
Besides Basarat's answer which works, there's also another solution: not doing anything. TypeScript generates a JavaScript file, which automatically gets placed in the same folder as the TypeScript file. When in Visual Studio, right click the folder your TypeScript file is in, and select "open folder in file explorer". You should see that the folder holds both the TS file you made, and the JS file that got generated.
You do not need to add this JS file to your project folder inside Visual Studio: you can just reference it. If you have an MVC project with a Scripts folder that has a file called greeting.ts (the one you make in the TypeScript tutorial), the path would be "~/Scripts/greeting.ts". Instead, just use "~/Scripts/greeting.js" (ending with js instead of ts). Visual Studio is smart enough to figure it out from there. This works with bundles as well.

how to use Typescript in (Solution>Add>Existing Web Site ...) projects?

When i create a project by adding an existing web site project
there is no typescript template in (add->new file) .
What should i do ?
I'm using visual studio 2013 update 3 .
From the typescript website:
Visual Studio 2013 Update 2 includes TypeScript. Visual Studio 2012
developers can install the TypeScript editor plugin to get rich
TypeScript tooling. There is also TypeScript support for other editors
available
http://www.typescriptlang.org/
It doesn't get installed as a template it is a plugin.
UPDATED
I opened my sample MVC 5 solution, right clicked on my Scripts folder and selected 'Add New Item'. In the dialog that pops up I selected from the treeview Visual C# -> Web -> Scripts. I select TypeScript File and click Add. If you have not added typescript to your project before you should get a message like this:
I'll guess that if you don't get that message the first time you add a typescript file to your project that something went wrong and this is why you cannot compile it properly.

Compile error when trying to debug a Visual Studio integration project

I'm currently working on a Visual Studio integration project for VS2010 (a custom highlighter) I'm using Irony and the LanguageServiceTemplate from this Code project article. However that template is build for 2008 and the changes made in VS2010 when it comes to integrating breaks the template.
When I try to compile I get the following error:
Source.extension.vsixmanifest file not found in project. If a file with this name is present in the project, make sure the build action is set to "None".
Any ides of what I can do to fix it?
You have two options depending on how your package is constructed.
1) Edit the project file and remove the following line.
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
If you do this, you will lose a few things like the automatic zipping of your item and project templates.
2) Add a source.extension.vsixmanifest file to the root of your project. You can get one by creating a new VSIX Project. After you install the Visual Studio 2010 SDK, this is under the Extensibility category. If you add no content, it won't create a vsix file.
The second method is probably the best route to go. I have a specific VSIX project that I use to pull in various other package projects. If you only have one project, you can use the new vsixmanifest file to include the project to make an installer.

Resources