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

349 questions
99
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
  • 11,093
  • 14
  • 45
  • 59
75
votes
6 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,510
  • 1
  • 18
  • 24
74
votes
14 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
  • 43,095
  • 21
  • 121
  • 135
68
votes
6 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
  • 5,607
  • 8
  • 43
  • 64
35
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
  • 12,803
  • 14
  • 64
  • 119
34
votes
4 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
  • 17,505
  • 36
  • 124
  • 222
32
votes
7 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…
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,421
  • 48
  • 170
  • 299
29
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
  • 6,985
  • 10
  • 45
  • 64
29
votes
5 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
  • 652
  • 1
  • 6
  • 17
27
votes
4 answers

Compile multiple dotnet core projects in one step using dotnet cli

Assuming this folder structure SampleApp global.json Src Web project.json Startup.cs ... Model project.json …
wal
  • 16,300
  • 7
  • 69
  • 104
26
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
  • 11,403
  • 3
  • 41
  • 60
24
votes
7 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
  • 107,550
  • 65
  • 332
  • 414
21
votes
4 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
  • 5,370
  • 10
  • 39
  • 82
19
votes
3 answers

what is major difference between dotnet publish and dotnet pack

What is the major difference between dotnet pack and publish? From Microsoft's description, my understanding is that pack creates a package while publish creates package + DLL. Is this correct? If so, why not just always use publish and not use the…
Lost
  • 8,195
  • 27
  • 95
  • 163
1
2 3
23 24