vscode terminal doesn't recognize externals - windows

I can't run external commands in the terminal like I can in cmd.exe
I am using vscode 1.50.1
I have environment variable PATH set to:
C:\Program Files\dotnet;C:\Python\Python36\Scripts;C:\Python\Python36;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\MongoDB\Server\3.6\bin;C:\Users\axw04\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\nodejs;C:\Windows\System32;C:\Program Files\Git\bin;C:\Program Files\Java\jre1.8.0_191\bin;C:\Users\axw04\AppData\Roaming\npm;%USERPROFILE%.dotnet\tools;C:\Users\axw04.platformio\penv\Scripts;
In the normal cmd.exe I can run the dotnet command without any problem:
eq. dotnet --info
But in the terminal of vscode I get an error
'dotnet' is not recognized as an internal or external command,
operable program or batch file.
I also tried switching to powershell as default shell without any luck.
I reinstalled the latest
.NET Core 3.1 SDK (v3.1.403) - Windows x64 Installer
nothing seems to work.
my system is a windows10 laptop.
I have both vscode and visual studio 2019 installed.

Related

Error: vscall.bat is not recognized as an internal or external command, operable program or batch file

When I try to call vscall.bat or vcvarsall.bat in my x64 Native Tools Command Prompt for VS 2019, I get the error showed in the title. I tried following this tutorial: How to tell CMake where to find the compiler?
Does anyone know how to fix this?
When I try to call vscall.bat or vcvarsall.bat in my x64 Native Tools Command Prompt for VS 2019
Since you are already in the x64 Native Tools Command Prompt for VS 2019 you do not need to call vcvarsall.bat. It was already done when you opened that command prompt.

How to install Visual Studio Code's `code` command permanently?

I just followed the top-voted answer here and successfully installed Visual Studio Code's code command in my terminal.
However, the code command fails to launch Visual Studio Code every time after I restart my MacBook Pro.
~ code
zsh: command not found: code
Is it possible to install code permanently so that I don't have to install it every time I turn on my MacBook Pro?
~ where code
/usr/local/bin/code
~ ls -l /usr/local/bin/code
lrwxr-xr-x 1 myName admin 167 Aug 5 13:41 /usr/local/bin/code -> /private/var/folders/bh/525lnbns1213cx2651s97my00000gp/T/AppTranslocation/EA379FC4-05D2-4739-BE49-1D8870E47B8A/d/Visual Studio Code.app/Contents/Resources/app/bin/code
I also find out that the folder EA379FC4-05D2-4739-BE49-1D8870E47B8A get deleted after I restart my laptop.
This is the reason that I cannot run code after the laptop is restarted.
Why is code installed in a temporary folder?
My MacBook Pro's version is macOS Sierra version 10.12.6
The reason that code get installed in a temporary folder is that I placed Visual Studio Code.app in Downloads folder.
After I moved it to Applications folder, launched it, and installed code command, the code is not installed in a temporary folder anymore.
you can this code in visual studio code command palette to register shell command.
Open the command palette.
shell command
and run this command to install 'code' command
install 'code' command in PATH
And then restart terminal

Where is the dotnet command executable located on Windows?

I am exploring the new Entity Framework Core (NOT in conjunction with ASP.Net, what I am coding is just a WinForms app) and found some tutorials mentioning a dotnet command line command needed to create "migrations". When I try it, however, it says 'dotnet' is not recognized as an internal or external command, operable program or batch file. I have searched my hard drive for "dotnet.exe", "dotnet.bat" and "dotnet.cmd" but have found nothing. I use Visual Studio 2015 Community Edition. Where do I find this command executable? What am I to add to the %PATH% environment variable for it to work?
dotnet.exe is located in
C:\Program Files\dotnet>
If you are using command prompt and getting message that 'dotnet' is not recognized as an internal or external command, operable program or batch file" then first check the above path. If you found the above path then just copy it and set it as an environment variable of your PC.
Steps:
Open control panel>System and Security>System
Click on Advanced system settings
In advanced section, click in Environment Variables
In System variables, select path and edit
After semicolon, write "C:\Program Files\dotnet"
Click on Ok button till end.
now to check whether its working on not. Just open command propmpt and type
dotnet --version
This will show the dotnet version installed in your PC.
I've just found the answer myself. It seems like the dotnettool does not get installed with Visual Studio. Installing .NET Core tools preview for Visual Studio (direct link to the .NET Core 1.0.1 tools Preview 2: DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe) resolved the problem by adding %ProgramFiles%\dotnet\dotnet.exe.
I have faced another problem after this, however: the dotnet tool running but saying No executable found matching command "dotnet-ef" but this is a matter of another question. I will, however, share the solution here once I find it.
UPDATE:
As promised, here are the question and the answer about the thext problem I have faced (the No executable found matching command "dotnet-ef" error).
And here is the solution for the next one (the ... violates the constraint of type 'TContext' error)
For me it is located at C:\Program Files\dotnet
You need to install .NET SDK separately. You can download and install from https://download.microsoft.com/download/1/1/5/115B762D-2B41-4AF3-9A63-92D9680B9409/dotnet-sdk-2.1.4-win-gs-x64.exe
More details : https://www.microsoft.com/net/learn/get-started/windows
Also I did not have to set up path variable. After running above installation dotnet was automatically added in path. Just open a new cmd and run -
C:\Users\anike>dotnet --version
2.1.4
I have the same issue on windows 10 64bit after installing dotnet core SDK 3.1
To resolve it, I defined the environnement variables path for .netcore 3.1 and restarted my machine.
Download and install .NET core from https://dotnet.microsoft.com/download/dotnet-core, open a new prompt once it's installed.
dotnet
You will get the following message if installation is successful. The path where dotnet.exe is will be added to PATH as part of the installation.
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET Core information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
If you're using .NET Framework 4.x and WinForms, you probably don't want to use the .NET Core tools (i.e. dotnet ef). Instead, install the Microsoft.EntityFrameworkCore.Tools package and use the NuGet Package Manager Console (or PMC) PowerShell cmdlets: Add-Migration, Update-Database, etc.
To future readers
If on Windows check if you have multiple installations of dotnet on Program Files and Program Files (x86) or Program Files(x32). win + R open cmd, type
where.exe dotnet
only Program Files should have dotnet. Restart Visual Studio .
I had the following error in Visual Studio when first installed .net sdk. I finally just closed VS code, reopened VS Code, and it worked fine.
'dotnet' is not recognized as an internal or external command, operable program or batch file
For windows the reason was that it need to run from a Command prompt outside from visual studio.
execute this command in command prompt,
dotnet run
then application run in https://localhost:5001

Setting Up .NET Build Environment with setenv - Two Warnings - Could not find vsvars32.bat Visual C++ Does not appear to be installed

I'm trying to compile some netmf firmware using MSBUILD with Yagarto. I'm doing it on a machine with VS2012 and all the right pre-requisites installed. From a command prompt as administrator, I go to the NetMF Porting Kit folder, where all the source code lives, I call setenv_gcc.cmd 4.6.0 c:\yagarto46
Doing so yields two warnings:
WARNING: Count not find vsvars32.bat
WARNING: VISUAL C++ DOES NOT APPEAR TO BE
INSTALLED ON THIS MACHINE.
When I try the above command from VS2012 Developer Command Prompt as Administrator I get the following ERROR
ERROR: Cannot determine the location of the VS Common Tools folder.
I've done the path modifications in Environment System Variables with no luck.
Thanks!
VS2010 command prompt gives error : Cannot determine the location of the VS Common Tools folder
I modified the vsvars32.bat file in the vs11 and vs10 folders accordingly and the error went away... Now onto eliminating my build errors....

Visual Studio 2012 Command Prompt expected environment pathway not included

Recently installed (and re-installed) VS 2012 Ultimate with Blend
The VS Command Prompt doesn't seem to have a reference (are they called environment pathways) to the folder "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\". This means the following lines won't run from the command prompt (either as normal or as administrator)
msbuild buildapp.csproj /t:HelloWorld
Installutil WindowsService1.exe
To use msbuild or Installutil I need to specify the full pathways for the above to run.
Is the above a by design change that MS have made to VS?
In my VS 2012 environment I can find the path you say is missing. I opened the "Developer Command Prompt for VS2012" and did PATH to verify and also ran InstallUtil.exe successfully.
Make sure you open the correct prompt, mine was started using %comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat"
Here's Microsoft's explanation (err..justification :)) of the convoluted path structure :
For 32 bit builds :
Setting the Path and Environment Variables for Command-Line Builds
.. and 64 bit builds :
How to: Enable a 64-Bit Visual C++ Toolset on the Command Line

Resources