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

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.

Related

Unable to create Cross-Platform .NET Standard Plugin Templates project

I am trying to develop my own plugins in xamarin form. I installed Cross-Platform .NET Standard Plugin Templates in VS 2019. I can see in description Cross-Platform .NET Standard Plugin Templates works with 2017 and 2019.
When I try to create new project it keeps going on saying creating project.
When I look in the directory, I can see some files being generated.
It's an existing issue with VS2019
Creating a new Project with VS2019 shows missing references / they cant be loaded. Appeared after last VS Update.
If you wait long enough you can do the following :
Note- after last VS 2019 update- edit the csproj file and update the MSBuild.Sdk.Extras to version 2.0.54 so all dependencies load and the project will build.
UPDATE:
Had to download Visual studio 2017 to create the project

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.

Mindscape Web Workbench missing Sass SCSS Style Sheet template

I am using Visual Studio Community 2013 12.0.31101.00 Update 4 (with Web Essentials 2013 installed.
I downloaded Mindscape Web Workbench extension for visual studio. As it claims here: http://www.mindscapehq.com/products/web-workbench/getting-started#content
, it is supposed to install Sass SCSS style sheet template (the one highlighted in the photo in the link). However it is missing. The coffeeScript and Less Templates are installed normally. What can I do to bring back that specific template?
Although the template doesn't appear when using File->New File (probably a bug), I can add SCSS files through the Solution Explorer.(I have Web Development Environment settings)

VS 2013 Community Add new Typescript file missing

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.

Is it possible to provide custom content for the VS2012 Start Page?

Visual Studio 2012 (and 2010, too) has a Start Page that has links and streamed videos. Is it possible for my package to provide content on this page, e.g., create a separate section next to Welcome/Windows 8/etc.?
I finally got a custom start page working in VS2012 - my issue was I could not install the Start Page Project Template in 2012 as the extension only installs on 2010 (which I don't have access to) and my My Documents folder is mapped to a network drive, so putting the raw XAML file in My Documents/Visual Studio 2012/Startpages didn't work as Visual Studio refused to use this "untrustworthy file".
Download the Start Page Template from here.
Rename the file to .zip and extract it.
Copy the "\Solution\CSharp\Extensibility\StartPage.zip" file to your project template folder (by default "My Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#").
Create a new project using this template.
Follow the instructions here to upgrade from 2010 to 2012 start page.
Update the project properties target framework to 4.5.
Update the project references in the Control project by removing the Microsoft.VisualStudio.Shell.10.0 reference and adding the Microsoft.VisualStudio.Shell.11.0 and Microsoft.VisualStudio.Shell.Immutable.11.0 references.
Update the namespaces references in the xaml file by replacing the existing ones with the two below.
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"
xmlns:vsfxim="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.Immutable.11.0"
Replace the references to vsfx:VsBrushes keys to vs:EnvironmentColors keys, e.g. vsfx:VsBrushes.StartPageBackgroundKey to vs:EnvironmentColors.StartPageTabBackgroundBrushKey
In the VSIX project, make the following changes to the source.extension.vsixmanifest file (values depending on if 2010 support is desired, it is not for me):
Add an author, the default empty tag is not allowed: <Author>Ken</Author>
Change/add the visual studio support version to 11.0: <VisualStudio Version="11.0">
Change the supported runtime edition to include 4.5: <SupportedFrameworkRuntimeEdition MinVersion="4.5" MaxVersion="4.5" />
The VSIX solution should now build and spit out a VSIX file in the project bin folder. Install this and you can now choose your Start Page from the drop down list in the visual studio options.
I haven't actually developed my custom start page beyond this, but hopefully it is a helpful to people wanting to get started developing them with VS2012
EDIT: A project which includes a basic 2012 start page, custom control and can be deployed via VSIX: template
Custom Start Pages, via google:
http://msdn.microsoft.com/en-us/library/aa991992.aspx

Resources