Where is the dotnet command executable located on Windows? - 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

Related

How to generate vcvarsall.bat

My visual Studio 2015 installed without vcvarsall.bat.
This is not about how to find this file and I am also not a python developer.
MSDN states at the bottom of this page:
The vcvarsall.bat file can vary from computer to computer. Do not
replace a missing or damaged vcvarsall.bat file by using a file from
another computer. Rerun Visual Studio Setup to replace the missing
file.
I am running the installation through our local IT department so I only get a fixed version of the setup. It looks like this setup does not install the batch file.
I wonder what other means of generating this "file" (actually it is several files and a folder structure) there are - how does the visual studio setup generate this file and is that generation possible without running the whole setup?
You have some option to "install" vcvarsall.bat.
The obvious to rerun VS setup and add c++ features (maybe your IT dep is kind enough and...)
Install visual c++ build tools
Install windows sdk (select c++ related components)

Run c# visual studio project in windows, created in ubuntu

I've got a problem with Visual Studio console application created in Ubuntu 15.04. When I try to run c# program in Visual Studio in Windows 10 I get an error "visual project does not contail any commands in project.json and cannot be start". How to fix that?
I have only json file but I don't have any sln and csproj.
The easiest solution: create new, empty console app and paste content (.cs) files from linux repo to it. Build and compile.
Remember to resolve conflicts which may occur (libs used in linux environment may be problematic in windows).

Using npm from the command line with Visual Studio 2015 Web Project

After installing Visual Studio 2015 I am able to use the new editor features to add dependencies to Node packages and restore etc from within a Web project as per this documentation: http://webtooling.visualstudio.com/package-managers/npm/
Presumably Visual Studio must install node/npm somewhere in order to support these features, however it does not seem to modify my PATH to make these tools available on the command line (or via Visual Studio 2015 Command Prompt).
If I want to perform some npm operations on my project from the command line can I do this without installing node/npm again (which might become out of sync with the version of npm/node that Visual Studio is using) or is there a way to access the node/npm installation Visual Studio is using from the command line?
VS2015 installs node using Joyent's installer. It depends on the system-wide install and it does not have it's own specific or local version.
If you're command line is unable to find node.exe, I would first check your path property in your environment variables and add it if it's missing (it should be C:\Program Files (x86)\nodejs). If you see node's install directory there but still can't access it from the command line, reboot. Sometimes Windows needs to restart before it uses the updated path variable.
Hope that helps.

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....

Installing Qt with VS2010

I have followed the directions here to download and extract the files for Qt and prepare my VS environment for installation.
However, when I run the configure command listed there in a VS2010 command prompt, it says 'configure is not recognized as an internal or external command'.
Is there something wrong with my path or something? Where do I find the configure utility file?
Thanks for your help.

Resources