File compare on macOS with FreeFileSync and Visual Studio Code - bash

I struggling to make it work for me.
I have FreeFileSync (v10.20) and Visual Studio Code (v1.43.0) installed on macOS Mojave (v10.14.6) and would like to add a file compare context menu command, so
Step 1:
I added Visual Studio Code to my path as explained on their site (https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line):
Launch VS Code
Open the Command Palette (F1) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
After this, I am able to launch Terminal and run:
code --diff
Step 2:
I added the following option to FreeFileSync Preferences at 'Customize context menu':
Description: Compare with Visual Studio Code
Command line: code --diff "%local_path%" "%local_path2%"
The issue:
So far, it does nothing. No errors. No windows opened. Why?
Thanks for your help in advance!
Craby

OK, just I found out the solution myself, I hope this will help you guys, too:
The solution is to configure Visual Studio Code as external file compare (diff) tool in FreeFileSync as follows:
Description: Compare with Visual Studio Code
Command line: /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron --diff "%local_path%" "%local_path2%"
Note the \ backslashes to escape the spaces... without these it fails silently.
Enjoy!
Craby

Related

Visual Studio Code - Open file with folder from terminal (code)

i'm trying to make a bash script that basically creates a new directory and opens it directly through visual studio code
i've managed to do that, however, now i want to make it automatically add a 'README.md' file, and open it WITH the new folder
thank you
i couldn't find anything on the internet, nor with the code help command.
solved - run:
code /path/to/folder/ /path/to/file/
documentation for vsc cli

Visual Studio 2022: System.InvalidOperationException: "git" is not present in PATH

I'm trying to compile the following project:
https://github.com/xoofx/markdig
In Visual Studio 2022, How to resolve the error message:
System.InvalidOperationException: "git" is not present in PATH.
What's the correctly way to install 'git' for visual studio? I thought Visual Studio Already has git installed out of the box, judging by the label "Git" on the menu bar.
Here's a picture of my screen:
Menu: Tools->Command-Line:
Thanks for adding the picture. You need to have git installed. This can be done independently or through visual studio installer.
https://git-scm.com/downloads
It will ask you during installation if you want it to be added to the path - choose yes.
Once you have installed, launch the command window from start menu
and run git command. That should show something like this -
[2]
Once you have git command running from command line it should work from visual studio as well. Essentially VS is trying to launch that command from its shell and failing to find it because you dont have git installed.
VS does come with git installed but you have to choose it in its workloads. You have to go through all available installation options. See the screenshot below from VS 2017 installation workload. You can do this by re-launching your VS installer and selecting the products that you want installed. Since I use most of the things, I dont uncheck anything but that takes close to 50Gig space on the disk - something you want to be aware of.

How to open file in a specific application from the command line

I want to open a .md file in a repo in visual studio code from my command line. Does anyone know the command for this?
I am using the bash shell.
First, you need to have Visual Studio Code CLI. ( Try code --version in terminal to check if it's already installed or not ). You have to install it manually on mac OSX (see below). In windows and linux, the command line interface code should be readily available in the PATH.
To install it (in MAC)
Launch VS Code.
Open the Command Palette (⇧⌘P) and type ‘shell
command’ to find the Shell Command: Install ‘code’ command in PATH
command.
After that you can use:
code filename
to open the filename in Visual Studio.
For more information, click
code --help will give you more information.
For example, code -r filename will open the file in already opened Visual Studio window.

Visual studio does not install .vsix files

I've both VS 2012 and VS 2013 installed on my computer. The problem is that when I download an VSIX-File and open it with the Visual Studio version selector the file gets opened by VS but instead of installing it. VS opens the file as if it was an unknown binary format.
The attached image shows how VSIX-files are opened (happens with every file ... this is just an example):
I faced the same issue. Just use the VSIXInstaller to install the extension.
You can open "Developer Command Prompt for VS2012" tool in Start -> Microsoft Visual Studio 2012 -> Visual Studio Tools. On the console, run the below command:
VSIXInstaller <path to vsix file>
Open "Developer Command Prompt for VS2015" as administrator.
Type VSIXInstaller.exe vsixFilePath
Note that this way wouldn't work with me and gives me "Path to vsix file 'G:\Roslyn' is invaild or you don't have required access permissions". To solve this you need to put the path in a double quote like this:
VSIXInstaller.exe "G:\Roslyn SDK.vsix"
I got into a weird situation where in a fresh install of W10 and VS2015 Community, the Player Framework vsix installation won't start, either by dbl click or from command prompt using VSIxInstaller.exe, and would show no message at all. The solution was to open an elevated command prompt (run Developer Command Prompt for VS2015 as administrator) and then type VSIXInstaller.exe worked.
I am not clear whether you want to install or just view the contents of VSIX. If you want to install the extension, you just need to double click it and it will install (Do not try to open it with VS Version selector). If you want to see what is inside VSIX, it is basically an archive. So either try to use program like 7-zip to open it else, rename .vsix to .zip and then unzip it.
Further, there is also a chance that you have wrongly associated vsix files to be opened with Visual Studio. In such a case it will open in Visual Studio any case.
Finally, if you have wrongly associated the vsix to open with Visual Studio, try installing the extension using VSIXInstaller.exe found in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe
To add to the other answers, if the VSIX files either doesn't have an associated program to open with or opens with the wrong application, selecting the VSIXInstaller.exe as the associated commands re-enables the ability to double-click and directly install it (without the need to do it via commandline).
I faced a similar issue when I first installed VS 2017. This is what worked for me.
Resolution:
Restart VS 2017.(I hadn't restarted it before installation)
Install it from Tools->Extension & Updates.Search for "Perforce" and install.
I double clicked on this and it installed just fine.
Couldn't do it on VS2013 through the extensions dialog.
for me the problem was the extension InstallerProjects was on network server so I had to copy it to my machine (local) and it worked

Visual Studio crashes during runtime

Please can you help me with this VS 2010 issue. This issue comes out every time I want to run my project. Can it be fixed somehow? The screen shot isi aviable in attached file.
try registring IIS again...To do this follow the given steps...
go to C:\Windows\Microsoft.NET\Framework\v4.X folder from Command prompt
execute aspnet_regiis.exe -I command from Command prompt
close the Visual studio and re-open.
Try re-run the project again.
Thanks

Resources