Questions tagged [dotnet-cli]

For use of questions about the .NET Core command line tool-chain. This does not relate to dnx, dvnm, dnu or any of the previous tools build with .NET Core.

The .NET Core command-line interface (CLI) is a cross-platform toolchain for developing .NET applications.

Resources

Related tags

474 questions
116
votes
22 answers

The library hostpolicy.dll was not found

I have a simple .NET Core project (console app) that I'm trying to compile and run. dotnet build succeeds, but I get the following error when I do dotnet run: dotnet run Project RazorPrecompiler (.NETCoreApp,Version=v1.0) was previously compiled.…
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
108
votes
1 answer

Relationship between the dotnet cli and the new vs2017 msbuild

With the move from project.json to the new csproj format introduced with VS2017, I'm struggling to understand the difference between the dotnet cli and the new msbuild and when to use one over the other. 1) To build a new csproj netstandard library…
kimsagro
  • 15,513
  • 17
  • 54
  • 69
95
votes
7 answers

dotnet run OR dotnet watch with development environment from command line?

I am using dotnet watch command to run asp.net core project. However, by default, it is picking up the Production as an environment. I have tried both options using: 1) > dotnet watch ASPNETCORE_ENVIRONMENT=Development 2) > dotnet run…
Nexus23
  • 6,195
  • 9
  • 50
  • 67
88
votes
8 answers

dotnet publish doesn´t publish correct appsettings.{env.EnvironmentName}.json

When I issue the following command in the command line: dotnet publish -o "./../output" -c Release The dotnetcli publishes the project correctly. However, it does not copy the appsettings.Production.json file, only the appsettings.json. Why is this?…
peco
  • 3,890
  • 1
  • 20
  • 27
66
votes
13 answers

EF Core Error - No project was found. Change the current working directory or use the --project option

I am using Visual Studio 2015 and dotnet core and trying to develop an EF Core Code First project using Sqlite and this documentation / tutorial, which also uses Sqlite => NET Core - New Database When I try to add an initial migration from the…
54
votes
4 answers

Set default project in solution for dotnet run

I have created a solution and a webapi project in it's own folder. I have then added the project to the solution. I would like to be able to run dotnet run without specifying the project by setting a default (Like i would in Visual Studio) Is this…
4imble
  • 13,979
  • 15
  • 70
  • 125
43
votes
9 answers

how to add a new c# file to a project using dotnet-cli

I'm learning how to use dotnet-cli with VSCode. I've seen many commands on how to create solution, projects, add reference to projects... but I don't see anywhere in the documentation how to add a file. If remember, in RubyOnRails it was possible to…
Richard77
  • 20,343
  • 46
  • 150
  • 252
40
votes
3 answers

Could not load file or assembly 'System.Runtime, Version=7.0.0.0...' - After installing .NET Core 7 'dotnet watch run' not working

After the .Net 7.0 update, when I use dotnet watch run I get this error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The…
Omer
  • 8,194
  • 13
  • 74
  • 92
38
votes
3 answers

dotnet test > is there a way to show list of tests ran in console?

When running dotnet test, is there a way of showing a list of all tests ran in console instead of some output file? Would be ideal to see a list like this in console: x test1 test2 test3 x test4 instead of just overall test statistics (ran,…
dee zg
  • 13,793
  • 10
  • 42
  • 82
36
votes
5 answers

run single *.cs script from command line

Is there at last a easy way to execute c# script file from command line? I saw that discussion on github and according to this thread i think dotnet run Test.cs should do the job. But for my testclass which is: using System; namespace Scripts { …
silent_coder
  • 6,222
  • 14
  • 47
  • 91
35
votes
9 answers

dotnet is not recognized as the name of a cmdlet

We have downloaded and run DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe. After having closed and reopened our command prompt, running dotnet gives the following output. The term 'dotnet' is not recognized as the name of a cmdlet, function,…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
33
votes
2 answers

How to generate controller using dotnetcore command line

In Ruby on Rails, you can generate controllers using something like the following in command line: rails generate controller ControllerName action1 action2 ...etc Is there something similar in the dotnetcore cli for generating controllers? From…
Danoram
  • 8,132
  • 12
  • 51
  • 71
30
votes
1 answer

Use angular-tree-component in "dotnet new angular" project?

When trying to integrate angular-tree-component into a project created with dotnet new angular, I consistently run into an exception: void(0) is not a function. Either the tree never appears, or it appears briefly, but then the error happens and…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
30
votes
4 answers

.Net Core build a solution

If you try to run from the command line in the top directory of a solution made with visual studio: dotnet build My solution is architectured like that: MySolution.sln > src > MyProject1 > project.json > MyProject2 …
Fab
  • 14,327
  • 5
  • 49
  • 68
29
votes
4 answers

Is .NET Core ready to run on Raspberry PI 3?

I can find a lot of obsolete threads but a lot have been changed the last months. Is there currently any possibility to run .NET Core and/or ASP.NET Core on Raspberry with Raspbian (currently Jessie) without Mono? Or what do I need? I can find some…
PeterLiguda
  • 782
  • 1
  • 6
  • 17
1
2 3
31 32