TypeScript in Visual Studio 2013 - visual-studio

I very new to TypeScript. What is the right way of using TypeScript in Visual Studio 2013 update 3? Firstly i installed TypeScript for Visual Studio 2013. But i did not get anything. When i uninstalled TypeScript for Visual Studio 2013 extension and installed web essentials for VS 2013 update 3. I actually got type script support but only when i make new project. For existing project made with VS 2013 too i can not get compile on save. I checked Tools-> options-> Text editor-> TypeScript > Project to Enable Automatic compiling, but in this section VS tells me that some error occurs during loading. Recently i figured out that VS 2013 should have typescript support out of box. Is this mean that i don`t need Web Essentials? I just want to get compiling on save for VS 2013 what should i do?

To convert existing web project to Typescript aware and get Typescript Build tab in project properties you will need to add a bunch of stuff into your project file via text editor.
Add the following element at the top of Project element:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />
Add the following to conditionless PropertyGroup element
<TypeScriptToolsVersion>1.4</TypeScriptToolsVersion>
or 1.1 if I remember correctly previous version in case you have not 1.4 installed
Final nugget should go to the bottom of Project lemenet
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
This helped me once, but perhaps those instructions are too cumbersome and it will be easier to create new Typescript project and see what is in there related to Typescript

Related

How to get TypeScript files add in Visual Studio project

I've created a blank project in Visual Studio 2015 and then added an existing project web application. Next, I created a new folder namely as TSand then from Add New File prompt I am trying to add .ts file. But I am unable to see TypeScript file type.
Below are my visual studio and TypeScript details:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.7.02556
TypeScript 2.8.3.0
TypeScript tools for Visual Studio
I've below solutions but nothing is working on my side.
Add new file as js and then rename it to .ts or .d.ts
remove cache from AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
Any help will highly appreciated.
Try the following:
Go to settings, type in file associations and then click on Edit in settings.json. There, add the following:
"files.associations": {
"*.ts": "typescript"
}

How to integrate starcounter with Visual Studio 2013

I'm trying to integrate starcounter with visual studio 2013 by installing starcounter but this is not happening, how do I integrate with visual, after integrating how to create a simple project with starcounter.Thanks in advanced.
Starcounter 2.3 and newer does not support Visual Studio 2013 anymore, as presented on the https://starcounter.io/download/ page ("System Requirements"). Currently VS 2015 and 2017 are supported.
I think the only thing that needs to be integrated is creating a project from the template. Building is done by MSBuild, so I don't think VS version affects it.
Try to copy an existing project (e.g. https://github.com/StarcounterApps/KitchenSink) and change it to your liking. You will need to do some manual steps to add new pages:
Open your csproj file in an editor
add an entry for json file
<ItemGroup>
<TypedJSON Include="RadioPage.json">
<Generator>MsBuild:Compile</Generator>
</TypedJSON>
</ItemGroup>
add an entry for code-behind
<Compile Include="RadioPage.json.cs">
<DependentUpon>RadioPage.json</DependentUpon>
</Compile>
There may be a way to do this in a less manual way, but I don't know how to add dependent file in VS
In the docs, you can see how the Starcounter templates look and read how to use Starcounter without Visual Studio or the extension.
In short, it's no problem using Starcounter with Visual Studio 2013, although, you will miss out on some of the benefits that the extension come with.

How to Migrate Old Visual Studio Project to Visual Studio 2017?

Goal:
I try to open a visual studio project (c#) with CLR code for SQL Server from the Pluralsight course.
Issue:
I get no error messages just warnings below after One-way upgrade on Visual Studio 2017.
Your project is targeting .NET Framework 2.0 or 3.0. If your project
uses assemblies requiring a newer .NET Framework, your project will
fail to build. You can change the .NET Framework version by clicking
Properties on the project menu and then selecting a new version in the
'.NET Framework' dropdown box. (In Visual Basic, this is located on
the Compile tab by clicking the 'Advanced Compiler Options...'
button.)
When I open a solution with single project inside I get message below
The Project Needs to be migrated
or
The Project Needs to be loaded
Tried:
I tried editing csproj files with newer/older version numbers.
I tried different PCs with Visual Studio 2017 and Visual Studio 2015
Idea: Install Visual Studio 2010 as course was released in 2010 BUT I really do not want that.
When I got this issue, I tried reloading the project and when I did, it told me that I did not have an SDK installed and then it offered to install the SDK. Once I had the SDK installed, the project loaded and I was able to work with the project.

Unable to see typescript template in Visual Studio 2015

When I click on Add new file in VS I didn't see typescript template in VS2015.
I have installed typescript also externally from Microsoft Link and restarted VS and even system. I can see Typescript in Microsoft SDK's but still I'm not getting Typescript template in VS.

SystemJS modules with Visual Studio 2013 and TypeScript

I'm trying to use SystemJS modules in Visual Studio 2013 with TypeScript, but Visual Studio shows errors.
This is my setup:
Installed TypeScript Tools for Microsoft Visual Studio 2013 1.8.5.0
Uninstalled lower versions of TypeScript
Project file (VS 2013 does not support tsconfig.json):
<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
<TypeScriptModuleKind >system</TypeScriptModuleKind>
<TypeScriptTarget>es5</TypeScriptTarget>
This is what I see:
My project compiles successfully
In the browser, AngularJs runs successfully
But in Visual Studio, I see squiggly lines. Upon hovering it says 'expression statement is not assignment or call':
This issue is related to this question, however, the answer there is 'use VS 2015', which simply is not an option for me.
Is there any way to use SystemJS with TypeScript in Visual Studio 2013? It doesn't have to be ES6-style modules, just any combination of SystemJS and TypeScript will do. Thanks!
I don't know if you already tried to set SystemJS as module system in the preferences:
If still doesn't work, try to follow this guide: http://www.codeproject.com/Articles/1060262/First-Angular-App-with-TypeScript-and-Visual-Studi
from "Setting Up Visual Studio Project".
By the way, VB 2013 is a very old version of the software, is there any reason why shouldn't you migrate to a newer version?
It seems that there just isn't a solution for this. Upgrading to VS2015 is the only way to fix it.
You may need --allowSyntheticDefaultImports if angular doesn't have a default export.

Resources