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?
You can check your installed versions of . NET by navigating to Microsoft.NET\Framework under your Windows folders. The complete path is usually 'C:\Windows\Microsoft.NET\Framework.
dotnet.exe , installed under C:\Program Files\dotnet is a (command line) tool for. managing .NET source code and binaries. running applications ( dotnet.exe anApp.dll )
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 dotnet
tool 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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With