No executable found matching command "dotnet-add" - .net-core

I just did a fresh install of Fedora 25 (followed by an install of dotnet core 1.1) to explore the possibilities of doing some dotnet core development in an linux environment. On attempting to add my first package I received the following error:
No executable found matching command "dotnet-add"
I have seen some similar errors in other SO posts, but nothing that seems to be helping this issue. I attached some images below of the error, dotnet version info, system path, and dotnet location.
Thanks ahead of any tips!

You have installed a version of the dotnet SDK ("CLI" / dotnet-dev package) of the preview2 time, which is still project.json based. This version of the CLI does not contain the dotnet add set of verbs. These were publicly released with the 1.0.0 version. (at the time of writing, the current version of the SDK / CLI is 1.0.4).
Depending on which instructions you followed to install the components, make sure to update to new versions of the SDK / CLI (e.g. microsoft's install instructions for Fedora).
Note that the version of the SDK / CLI is a different one that the version of the runtime(s) on the machine.

Had the same trouble running VS 2017 Version 15.3.5 found a very helpful article
http://thedatafarm.com/data-access/no-executable-found-matching-command-dotnet-ef/
My Basic problem is the tooling is split into two:
One for CLI: Microsoft.EntityFrameworkCore.Tools.DotNet
One for Powershell: Microsoft.EntityFrameworkCore.Tools

Related

Is there a Linux equivalent of LightIngest.exe?

Is there a Linux equivalent of LightIngest.exe? The page of the utility does not mention that, search brings no luck either. In case it is not available, what is the preferred way to post ingestion items through CLI in Linux?
There is a .NET Core Kusto.Tools package - it is currently built for Core 2.1 and we will be working on updating it in the coming weeks.
https://www.nuget.org/packages/Microsoft.Azure.Kusto.Tools.NETCore/
Thanks to Vladik's answer I was able to download the package and use the included LightIngest.dll to execute an ingest through my Mac. Here are the steps:
Use nuget to download the Microsoft.Azure.Kusto.Tools.NETCore package installed:
nuget install Microsoft.Azure.Kusto.Tools.NETCore -Source nuget.org -OutputDirectory SPECIFY_OUTPUT_DIRECTORY
Navigate to the directory, and go to the tools subfolder. There you should find LightIngest.dll
Assuming you have dotnet installed (CLI) and SDK (v2.1) you should be able to execute an ingestion:
dotnet ./LightIngest.dll ...
Replace the ... with the Windows equivalent command that Azure Data Explorer Ingestion wizard suggested, and it should start ingesting!

Pipeline Nuget restore failing on .Net Core 3.0 Preview 8 project (NU1202)

I updated a project from netcoreapp2.2 to netcoreapp3.0 and use Preview8 SDK as well as Microsoft.EntityFrameworkCore.SqlServer, tools, and design.
I can build and run my projects locally just find (VS 2019). But when I try to deploy with Azure DevOps, the Nuget restore gives this error:
NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0-preview8.19405.11 supports: netstandard2.1 (.NETStandard,Version=v2.1)
Every reference to an EntityFrameworkCore package will result in that error.
I'm setting the .Net Core SDK in the pipeline to Preview8 via a global.json.
I have a NuGet tool installer task, bringing in the latest version, and a Nuget Restore task command running against my solution.
My problem was that I was using the Nuget Restore. Changing it to dotnet restore made the trick.
This problem is caused by an obsolete version of NuGet agent.
Use NuGet Install Tool task (a.k.a. Use NuGet) and setup the agent to the v5.x.
This is a low profile solution.
EDIT: Yay, I have enough rep to comment now.
It turns out the easier fix is to updatethe NuGet package version to the latest (5.3.0) in the "Use NuGet" task.
Not enough rep to comment on Fernando's response but it worked for me.
Edit the pipeline's Agent tasks:
add .NET Core, Display name: dotnet restore, Command: restore
set up other properties pretty much the same as the existing NuGet Restore
remove NuGet restore
Pipeline Nuget restore failing on .Net Core 3.0 Preview 8 project (NU1202)
If you are using the host agent, you should make sure you have install the netcoreapp3.0 on the agent. You could use the task Use .NET Core to install it:
Note check the option Include Preview Versions.
Note: Since netcoreapp3.0 supported by Visual Studio 2019, so, you need to make sure your agent is Hosted Windows 2019 with VS2019.
Hope this helps.

What does the "reflecting any global.json" message mean in dotnet info output?

This is what I see when I do a dotnet --info on my Windows 10 system:
It says:
.NET Core SDK (reflecting any global.json)
I honestly don't understand what "reflecting any global.json" would mean. Before posting this question, I did several searches and could not find any explanation.
When one runs the dotnet command, and multiple SDK version are installed on the system, the exact version used can be set in a global.json.
So I believe it means that the version printed in console is what may come from global.json, if there is such a file.
You can try this by creating global.json in the current directory via dotnet new globaljson --sdk-version 2.1.600 (referring to versions available on your machine). When you use dotnet --info (or any other dotnet <verb> command), the CLI in version 2.1.600 will be used.
global.json file is searched for in the current directory and upwards the hierarchy, so I think it's just saying "watch out, the version you see may be different than you expected because of this global.json somewhere".
To confirm it's nothing extra you can even take a look at .NET Core CLI sources - here and here. There are no special conditions why "reflecting any global.json" is printed.

How to restore an ASP.NET Core project with Ubuntu

Recently, I created an asp.net core project using Visual Studio Code on Windows and pushed it to GitHub. When I cloned the repo from GitHub and attempted to do a dotnet restore on the project on Ubuntu, an error message stating there was no project.json file was returned. Can anyone point me to a resource that will show me how to properly restore a .net core project from a Linux machine? Thanks!
So it seems like on each of your machines you are running different versions of the .net core SDK.
A big caveat with what you are trying to do. Are you trying to use Project Rider from Jetbrains on Linux? This only works with project.json (As of the time of this post) so be wary of that.
Now there are two ways to do this. If you are wanting the very latest on Linux and don't care about using Rider, then you can go here : https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and download the latest release for both Linux and Windows, install on both and you should be good to go.
If you do care about using Rider or you aren't ready to be strapped in for the wild ride of the latest release. Then you can do the following.
Find what version of the SDK you have on linux by typing into a terminal the following :
dotnet --version
This will spit out what version you have on linux. Go here and download the same version for windows and install it on your windows machine (https://github.com/dotnet/core/blob/master/release-notes/download-archive.md).
Now BEFORE you create a project, create a solution folder and create a file in it called global.json. Inside that put the following :
"sdk": {
"version": "1.0.0-preview2-003131"
}
Where the SDK version matches what you got from your linux terminal. Now create a folder for your project inside the solution folder. Run "dotnet new -t web" or a similar command to create your project. It will inspect the SDK version of the global.json and create a project with the tooling that matches. You should then be able to shift this project around any machine that has the same SDK installed, even if it also has the latest SDK's also.
If you do not create the global.json, it defaults to the latest version (Atleast on Windows).
Read a bit more about it here : http://dotnetcoretutorials.com/2017/02/17/developing-two-versions-net-core-sdk-side-side/

Where to download previous version of .net core sdk?

We have a project that uses .net core sdk 1.0.0-preview2-003121.
Currently, I'm setting up a CI server to do automatic builds. In the server, I'm getting this error because the .net core sdk that is installed is not the same as the one in the project.
ERROR
preview2-003121 which is not installed or cannot be found under the path C:\Program Files\dotnet.
I did a command line check dotnet --version and it gave me 1.0.0-preview2-003131
Where can I download older versions of the .net core sdk? I have tried the following links and they give me the latest version for the download
https://github.com/dotnet/cli
https://www.microsoft.com/net/core#windows
This article explains how to install the correct .net core version. HTH.
http://blog.stephencleary.com/2016/06/dotnet-netcore-versions.html
I was able to just get away with following
download https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/1.0.0-preview2-003121/dotnet-dev-win-x64.1.0.0-preview2-003121.zip
copy 1.0.0-preview2-003121 directory inside dotnet-dev-win-x64.1.0.0-preview2-003121.zip\sdk
paste in C:\Program Files\dotnet\sdk
Note: I had newer sdk version already installed(1.0.0-preview2-1-003177)
---Update---
Official download location is https://github.com/dotnet/core/blob/master/release-notes/download-archive.md as mentioned by vinicius-paiva and manoj-attal.
If you are looking to download specific version of .Net core, you can download from here. It worked for me.
Dot Net Core Download Archive List
Install using the chocolatey packages, of course.
Even though it is a late answer, it might help others.
Check these out.
https://github.com/dotnet/core/blob/main/release-notes/download-archive.md
https://www.microsoft.com/net/download/all

Resources