Unable to find the TF executable while adding tfs to VSCode - visual-studio-code

I am adding TFS to Visual Studio Code IDE(1.42.0) for that I have installed Azure Repos extension.
In VS code at File-->Preference-->Setting-->Tfvc:Location, when I am entering path C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe.
Getting error
(team) Unable to find the TF executable. Please ensure TF is installed
and the path specified contains the filename.
How can I solve this issue?
Edit 1: After installing Azure Repos extension, I am entering above path in tfvc:Location(for both tabs User and Workspace), but after entering path nothing happens. Check below screenshot
Edit2: Now I am getting this error at right below in VS code IDE

Since you have not got any help yet. I will take a shot. Any chance there is a issue with finding the executable and casing for the extension? My local TF is capitilized. \TF.exe
Also might want to checkout the Github and readme for TFVC.

Make sure you have installed VS on your computer. With a typical installation of Visual Studio, the Windows version of the TFVC command line client (tf.exe) is available under the Program Files (x86) folder. It will typically be placed in a location similar to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe. On the 2017 version of Visual Studio Community, it can be found in a location similar to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe.

I found a .vscode folder in my project
delete it, close and reopen vscode solved the problem

Related

Visual Studio Code Install Multi-User Image / School Environment [duplicate]

I've put Visual Studio Code on OneDrive, for the purpose of syncing it with its settings across my devices.
However, extensions are stored in %USERPROFILE%\.vscode\extensions on Windows.
Is it possible to change this folder's location so I can put it in the main Visual Studio Code folder?
At first I thought that copying the extensions in the resources\app\extensions of Visual Studio Code folder will be a nice workaround, but that doesn't work.
I've also searched for a solution on the documentation page and in the user settings, with no results.
What I did - after installing Visual Studio Code for the first time, I checked the documentation and added at the end of 'Target' field of editor's shortcut the following (there's a space before the two dashes):
--extensions-dir="DRIVELETTER:\VSCODE\extensions"
--user-data-dir="DRIVELETTER:\VSCODE\settings"
where DRIVERLETTER and VSCODE are the corresponding drive and directory where Visual Studio Code is installed. So mine looks like this:
"D:\Microsoft VS Code\Code.exe" --extensions-dir="D:\Microsoft VS Code\extensions"
Here is for the user data directory:
"D:\Microsoft VS Code\Code.exe" --user-data-dir="D:\Microsoft VS Code\settings"
Accessing the 'Target' field is done by right-clicking the shortcut and choosing 'Properties'
Anyway, there's a simpler solution to that problem - just use the portable version of Visual Studio Code. It works under Windows, Linux, and macOS:
Enable Portable Mode
Windows and Linux
After unzipping the Visual Studio Code download, simply create a data folder within Visual Studio Code's folder:
|- VSCode-win32-x64-1.25.0-insider
| |- Code.exe (or code executable)
| |- data
| |- ...
From then on, that folder will be used to contain all Visual Studio Code data, including session state, preferences, extensions, etc.
The data folder can be moved to other Visual Studio Code installations. This is useful for updating your portable Visual Studio Code version: simply move the data folder to a newer extracted version of Visual Studio Code.
macOS
On macOS, you need to place the data folder as a sibling of the application itself. Since the folder will be alongside the application, you need to name it specifically so that Code can find it. The default folder name is code-portable-data:
|- Visual Studio Code.app
|- code-portable-data
Portable mode won't work if your application is in quarantine, which happens by default if you just downloaded Visual Studio Code. Make sure you remove the quarantine attribute, if portable mode doesn't seem to work:
xattr -dr com.apple.quarantine Visual\ Studio\ Code.app
Note: On Insiders, the folder should be named code-insiders-portable-data.
UPDATE 14.12.2021
From Visual Studio Docs
Note: Do not attempt to configure portable mode on an installation from the Windows User or System installers. Portable mode is only supported on the Windows ZIP (.zip) archive. Note as well that the Windows ZIP archive does not support auto update.
A little hack:
Create a symbolic link to the folder %USERPROFILE%\.vscode\extensions under the Visual Studio Code install path.
https://code.visualstudio.com/docs/editor/extension-gallery
code --extensions-dir 'new_directory_to_set'
Set the root path for extensions.
Follow the below steps for changing the extension path in VS.
Set "code" path in environment variable.
path = VS_CODE_INSTALL_DIRECTORY/bin;
Open VS , in VS terminal execute the below command.
code --extensions-dir "new_directory_path"
Install the required extension.
All Done.
Note:Dont forget to vote the answer
According to this page, after installing VS Code we should make a language profilers folder like this:
mkdir code_profiles
cd code_profiles
mkdir code-ruby
cd code-ruby
mkdir exts
mkdir data
For Windows, I prepared a batch file (.bat) for each language I work on, it contains this line:
Start "" "D:\programs\VSCode\code.exe" --extensions-dir D:\programs\VSCode\code_profiles\code-python\exts --user-data-dir D:\programs\VSCode\code_profiles\code-python\data .
This is for Python. If I work on PHP, I will make code-php folder, then make exts and data folders in it and prepare another batch file for PHP, just like the one I made for python.
I put this batch file on the main project folder then double click on it to run VS Code with the preferred profile.

Visual Studio Code deleted files after crash

Visual Studio Code has crashed and deleted all files and all file changes I've been working on for the last 5 days, although I've saved them. Is there any solution for recovery ...
If you are using Windows, your Visual Studio code files can be found at %appdata%/Code/Backups
If you are using MacOS, then you can find all your Visual Studio code files at
$HOME/Library/Application Support/Code/Backups
Same problem for me. The entire vs-code folder is empty!
I searched the recycle bin, vs-code backup folders, recovery tools for deleted files but found nothing.
Thanks to the message below, I found a copy of the code in the folder:
%appdata%/Code/User/History

Visual Studio Code always uses old version of tsc

I am using typescript as a way of creating javascript for a webpage. My first attempt at using the tsc compiler produced error TS1005 about a missing ';'. This is apparently because Visual Studio Code is using an old version of tsc.
I find I have two versions on my system (discovered using where tsc in a command window):
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js
C:\Users\my_user_name\AppData\Roaming\npm\tsc
C:\Users\my_user_name\AppData\Roaming\npm\tsc.cmd
where the first location contains version 1.0.3.0 and the second version 2.7.2.
The only way I can get VS Code to use the latest version is to type the full path, ie
C:\Users\my_user_name\AppData\Roaming\npm\tsc main.ts
into the terminal window. When I do this there are no TS1005 errors.
I would be very grateful if someone could explain in easy terms for a VS Code novice how to set it up so it will automatically pick up the new version of tsc.
Grateful for advice.
I faced the same issue.
However, changing the folder name "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0" to something else other than 1.0 (Example: 1.0.Original) worked for me.

"No extensions found" when running Visual Studio Code from source

When I try to install any extension in Visual Studio Code (i.e., by pressing Ctrl+P and then running ext install RustyCode), I get a message that No extensions found.
However, this only happens when I run VS Code directly from source repository. I.e., after:
git clone https://github.com/Microsoft/vscode.git
cd vscode
git checkout 1.0.0
scripts/code.sh
But, if I run VS Code from official builds, then I'm able to install extensions.
So, how can I enable downloading and installing extensions from Visual Studio Marketplace when I run VS Code directly from source repository? (Is Visual Studio Marketplace integration bundled separately in official builds?)
I'm on Ubuntu/Linux.
This can be fixed by adding following to product.json:
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
(This is can also be fixed by copying product.json from an official build (in the .zip archvie, product.json is under resources/app) which contains above lines).
More information: https://github.com/Microsoft/vscode/issues/1557
You can use code-marketplace extension in AUR to add microsoft marketplace registery in code OSS. This extension will installs a pacman hook that patches the file on every package update.
If you want to do the same for archlinux, have a look here => https://wiki.archlinux.org/index.php/Visual_Studio_Code , you have various possible options to solve the problem.
For Arch linux you could access the product.json file under this path - /usr/lib/code/product.json.
Just edit on the file the extensionsGallery with the following-
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
like #Vikrant Chaudhary said.
Extending the answer from #Vikrant Chaudhary. If anyone wanted to do the same thing on Windows, the path to product.json is here:
Windows path for VSCodium: C:\Program Files\VSCodium\resources\app\product.json

The web publishing extension is not installed which is required to publish

I was tring to deploy an ASP.NET Web Application to a Windows Azure Web Site by following the tutorial through this link: https://www.windowsazure.com/en-us/develop/net/tutorials/get-started/
After download the public profile, which is a ".PublishSettings" file, I go back to Visual Studio and right-click the project in Solution Explorer and select Publish from the context menu as the tutorial said. However, a warning box jumped up and it showed me that "The Web Publishing extension is not installed which is required to publish. You can install it from http://go.microsoft.com/fwlink/?LinkID=208120."
I already installed "Windows Azure SDK for .NET (VS 2012)" and I also tried to uninstall this and install again, but the same problem is still there.
Anyone knows how to solve this? I am really appreciated.
I ran into 2 issues, which were related. One was the web publishing extension is not installed which is required to publish, and the other was the web extension package did not load.
I'm upvoting and reposting user3918092's solution for others who run into this issue and do everything including:
Deleting the ComponentModelCache out of
C:\Users\...\AppData\Local\Microsoft\VisualStudio\12.0 and
C:\Users\...\AppData\Roaming\Microsoft\VisualStudio\12.0
Repairing Azure SDK 2.4 and VS2013U3 Uninstalling and reinstalling
both Azure SDK 2.4 and VS2013U3
Removing extensions from the solution
Ignoring the extensions on VS startup
Using devenv /setup and devenv /updateconfiguration to try to reset the configuration
The solution is:
Reinstall the following items to your GAC using the following commands from the vs command line run as an administrator:
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Internal.Contracts.dll"
Thanks to user3918092!
I had the same problem on Visual Studio 2013 (Asp.net and web tools 2013 extensions have not been installed)
Solve it by re-install Visual Studio 2013 update 3.
http://www.microsoft.com/en-us/download/details.aspx?id=43721
This has worked for me.
I had Visual Studio express 2012 then installed Visual Studio 2013 needed the azure tools so I installed 2.4. I lost publishing at this stage and
unistalled Visual Studio express 2012.
So that is how I think it got out of kilter.
The solution was to reset the assemblies for Contract and Publishing using the Developer command prompt as Administrator.
If you have used the default installation setting then this is probably the path
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Internal.Contracts.dll"
Same issue with Visual Studio 2015.1 after installing a Web Tools update.
The assmeblies that have to be installed into gac are now:
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.Core.Contracts.dll"
gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Microsoft.VisualStudio.Web.Publish.Contracts.dll"
I have the same problem. After reinstalling VS 2013 update 4 and Azure SDK 2.6 problem still persists.
But then I tried the next thing:
In section Control Panel > Programs > Programs and Features select and repair Microsoft ASP.NET and Web Tools 2013.4.
And publish option started to work again.
I had this issue upgrading VS 2013 Ultimate from update 3 to 4. I had also a message about Microsoft.VisualStudio.Web.PasteJson.JsonPackage did not load properly when loading a Solution.
Repairing VS was enough for me to work again the publishing option.
http://connect.microsoft.com/VisualStudio/feedback/details/758298/not-able-to-publish-web-application-after-installing-visual-studio-2012-rtw has a work-around but it's a painful reinstall with additional folder deletion.
register GAC also work when have this problem after update VS 2013.2 to VS 2013.3
I had similar problem, but my error is related to scaffolding item.
I need to uninstall visual studio and went through all the related folders, registry and re-install visual studio in order to make it work!
Folders that I checked:
%App Data%
%Program Data%
%Program Files%
Windows
Hope that help :)
I uninstalled VS2012 again. Before I re-installed (a 3rd time), I went to my user's AppData and Documents folders and found all instances of Visual Studio 2012 and deleted them. Then I re-installed VS2012 and now Web Publishing is working.
Folders I deleted after uninstall:
C:\Users\USERNAME\Documents\Visual Studio 2012
C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\11.0
C:\Users\USERNAME\AppData\Roaming\Microsoft\Microsoft Visual Studio\11.0
C:\Program Files\Microsoft Visual Studio 11.0
C:\Program Files (x86)\Microsoft Visual Studio 11.0
I had this happen today out of the blue for a vs2013 project that was publishing fine previously.
I solved it by downloading a 'Visual Studio Web Publish Update' package from here.