Typescript VS2013 - visual-studio

I have Visual studio 2013 Ultimate, and want to use typescript. I installed the plug-in:
http://www.microsoft.com/en-us/download/details.aspx?id=34790
It didn't show any errors during or after the install. When I started VS2013 again and went to File > New > Project, there was a TypeScript thing in the templates. But it said "Install the latest TypeScript for Visual Studio", and trying to create such a 'project' results in a "project creation failed" message.
I also tried making a new file, but there was nothing related to typescript. Making a new file and changing the extension to .ts didn't work either (the icon of the file shows that it's an unknown filetype).
How do I get typescript to work in VS2013?
EDIT: I noticed that there's no typescript listed in de list of installed extensions. Could it be that the plug-in didn't detect my VS2013?

Answering my own question based on the comments on the question and own experiences. For when other people find this question.
It helps to restart your computer after installing the typescript plug-in.
And the Web Essensials 2013 plug-in doesn't mix well with typescript, so disable that to avoid Visual Studio crashing. (credit to Ken Smith; see comments on question).

Related

Target Framework not installed when opening a Unity project with Visual Studio 2022

I am trying to open a C# solution that has been generated from a Unity v2020.3.19f project with Visual Studio 2022. Opening it with Visual Studio 2019 works just fine, but there are reasons I'd like to be able to open it with v2022 (such as GitHub Copilot). I did not have issues with this on my previous install of Windows 10.
Upon opening the solution in VS2022, I get the following pop-up prompt for every project in the solution:
Choosing the first option updates the target project to .NET Framework 4.8 and loads the project, but the whole file appears with red lines. When hovering over an underlined bool Property, the error shows as: `CS0518: Predefined type 'System.Boolean' is not defined or imported.
Choosing the second option opens this URL in my browser, prompting me to install .NET Framework 4.7.1 targeting pack (which was already installed via the Visual Studio Installer). When I try to install the .NET Framework 4.7.1 runtime, the installer responds with .NET Framework 4.7.1 or a later update is already installed on this computer. When I try to install the .NET Framework 4.7.1 Developer Pack, the installer allows me to choose from "Repair", "Uninstall", or "Cancel". Repairing has no effect.
I installed both versions of Visual Studio (2019 & 2022) the usual way through the Visual Studio Installer, along with the "Game Development with Unity" workload, which tells me it's installed all dependencies just fine:
Here's what I've tried so far:
Uninstall & reinstall all versions of Visual Studio through the Visual Studio Installer
Uninstall & reinstall Unity, with the Visual Studio module installed through Unity Hub (which just opens the Visual Studio Installer for me to choose which version I want to install)
Regenerate project files through the Unity Editor
Uninstall any references to .NET Framework through the Control Panel
Try reinstalling .NET Framework targeting pack 4.7.1 either from the Visual Studio Installer or manually through the Microsoft SDK website from the prompt
Nothing works for me. Any help on how to make VS2022 stop complaining is greatly appreciated.
Update 1: I found a couple of threads where people suggested simply pressing the Regenerate project files button in "Edit -> Preferences -> External Tools`. This has not helped me.
Update 2: I've tried everything I can possibly imagine, in different orders and different combinations. I even reinstalled Windows 10 to no avail. It's like Visual Studio just doesn't want to accept that the .NET Framework 4.7.1 targeting pack is installed. Please help :(
check this
https://learn.microsoft.com/en-us/answers/questions/733018/visual-studio-2022-cannot-locate-installed-net-fra.html
If you modified the value of ProgramFilesDir(x86), just to modify it back to C:\ProgramFiles(x86) can solve the problem
That is a very interesting problem, my main solution for you to first try is to make sure you are even targeting the correct .net framework in UNITY before you even build the solution. You are using the .NET 4.x, you need to go into your configuration settings and player settings in unity and ensure its not on a different version, for me, unity still defaults to .net standard 2.0. Follow the steps located here. To do so.
Another solution is to see if that first option actually gives you errors that prevent you from using unity, because I know that Visual Studio Code has problems occasionally where it tells me im wrong, my program is wrong, every life choice I have made was poor and I am poor, yet in unity, there are no errors showing in the console and I can hit play no problem. In that case I just had to rebuild a few times and fiddle with vs code until omnisharp stopped yelling at me.
Apperently I have been in a similar situation as when you were getting the error "Predefined type 'System.Object' is not defined or imported" because looking into it, I already have clicked on some of the links, try this one if that error persists. If you cannot prevent the errors to begin with, I would recommend you trying to fix the upgraded version from option one as that is more than likely going to get you the closest to a solution.

Visual Studio syntax highlighting / autocomplete not working correctly

My Visual Studio does not highlight or autocomplete any Unity3D commands any more. I created a new script when noticing that. I restarted VS, reinstalled VS, also reverted all script changes I made today in my project but the result is still the same. Also I now get errors when trying to open my project file. It says it needs a migration and isn't compatible with the current Visual Studio version installed.
The actual error reads "The application that is based on this project type was not found." [translated from German].
I found similar posts on the web where reinstalling VS resolved the issue. Unfortunately, it did not for me. This is how it looks:
Anybody knows how I can fix this?
Ok, I was able to resolve this issue using this trick:
"Do me a favor... if this is Visual Studio 2017... hit your start menu and find Visual Studio Installer... Run it... select "Modify" and select individual components... find Visual Studio Tools for Unity... if it's installed, untick it and uninstall it, then run the installer again and reinstall it. Otherwise, just tick it and install it."

TSLint in Visual Studio 2015/2017?

My organization uses TSLint pretty heavily for quality-checking our Typescript code, and it provides a valuable service to us! However, we use Visual Studio 2015 & 2017 as our main IDE and the only way to get the linting results it to run a gulp/grunt task which prints the output to the Task Runner Explorer console. It works, but it's slow and not the best development experience.
In smaller projects on my own I've used VSCode, which has a fantastic TSLint plugin that highlights linting violations as you make them, and provides access to the auto-fixers that some TSLint rules have. Like this:
Is it possible to get this same functionality in Visual Studio 2015/2017? The immediate feedback is a life saver when writing TypeScript code.
As #Hermann Gruber has mentioned, in Visual Studio 2015 Mads Kristensen's Web Analyzer extension provides support for TSLint of the kind you require.
For Visual Studio 2017 and 2019 I have now personally upgraded Mads' extension, and rebranded it as 'TypeScript Analyzer' as it only supports TSLint. It's available in Visual Studio's Extensions and Updates Gallery under 'TypeScript Analyzer'.
This is something I coded in a day or two (note that I haven't worked with C# for a few years):
https://github.com/vladeck/TSLint
It is a start of (hopefully) worth-wile Visual Studio 2017 extension that can mark .ts code withing the editor, based on the installed tslint and tslint.json configuration.
It is not published on the marketplace yet (a lot more coding to do), but you can download and build it yourself. Give it a try, If you have the time. The more people try it out, the more I will have data needed to make it worth-wile.
This is reported as an issue in the Visual Studio Developer Community.
https://developercommunity.visualstudio.com/content/problem/22907/please-support-tslint-as-how-its-supported-in-vs-c.html
The status is "triaged", so I assume that a comparable feature is not (yet) available. You may want to upvote the issue, so that it gets more attention by the VS development team.
EDIT: As noted in the following question, the visual studio plugin web analyzer provides support for tslint in VS 2015 (but not VS 2017):
Set up TSLint for VS2017
Looks like if you are using typescript 3.0 or higher you just need to add tslint plugin into your tsconfig file. Install typescript-tslint-plugin below and you may need to restart visual studio (or simply close all your files and re-open them)
https://github.com/Microsoft/typescript-tslint-plugin
First
npm install --save-dev typescript-tslint-plugin
Then
{
"compilerOptions": {
"plugins": [
{
"name": "typescript-tslint-plugin"
}
]
}
}

Integrate ESLint with Visual Studio 2015

I am using ESLint for JavaScript. I installed it in my machine and am able to run and check for the errors in the file that I want to. Everything is good but if I have to use it only from command prompt I have to manually run this for each file or a folder. I am thinking about integrating this into Visual Studio so that when I run it like "Run ESLint on solution" it will give a list of warnings/errors for all the JS files in the solution. Even if we can't do that, is it possible to select a file and to run ESLint on that file in Visual Studio 2015?
I added ESLint to external tools in Visual Studio:
But when I run it, it's not showing any errors or anything. It is just showing the details of the help command. How do I run this on a particular file?
Web Analyzer extension has now been built in to Visual Studio in the .NET Core Tooling Preview 1
Follow the link to download the installer for
.NET Core Tooling Preview 1
You can install Web Analyzer extension as well, but after the restart you will get a prompt:
You can use WebAnalyzer plugin for Visual Studio, which does JavaScript linting through ESLint. It should highlight javascript errors every time you save your file, so it's a bit nicer then doing it through the menu. If you don't want to use plugin, you can setup a new menu item in the Tools > External Programs menu. Make sure to use ESLint's visual studio formatter that should allow you to double-click on the error and have Visual Studio take you to the line where the error occurred.

Can't open a TFS build process template with Community Build Extensions in VS2012 using the dummy-project-with-refrences trick

I'm trying to open a TFS Build Process Template (DefaultTemplate.11.1.xaml) file, incorporating an activity from Community TFS Build Extensions. I'm following instractions from here, section Get the custom activities into Visual Studio. I had no problems with that back in the RC version of Visual Studio 2012 but now, after upgrading to the release version, an attempt to open the file ends up in an error:
System.Xaml.XamlException: 'The type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ could not be resolved.'
TFS itself doesn't seem to have any problems running builds based on this template.
I am able to open the file without the trick, but then of course the custom activities are not displayed properly.
Check this out:
http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/30/Type-InArgument(mtbwaBuildSettings)-of-property-BuildSettings-errors-in-TFS-2012-RTM-builds.aspx
Quote:
"if the Visual Studio class library project you were using to manage the process template editing was targeting .NET 4.5, it needed to be 4.0. Well with Visual Studio 2012 RTM this is no longer the case, in fact it is the other way around."
I don't really think this is a great answer but I don't have enough rep to comment...
Build action on the xaml file is set to None?
I had a similar issue when opening build templates in VS 2012 RTM, but I was able to open the xaml "a little," meaning that I could open it in the workflow designer, but a lot of it was just the error activity. I found some errors to the effect that I should add references which I had not needed before (neither in VS 2010 or VS 11), such as PresentationCore and PresentationFramework. I wish I remembered more detail to pass on to you on this point.

Resources