Do I use the .NET CLI if I want to create an ASP.NET Core 1.0 app that uses the .NET Framework? Is .NET CLI only for the new .NET Core library or both Core and .NET 4.6?
-
1Are you referring to the [Common Language Infrastructure](https://en.wikipedia.org/wiki/Common_Language_Infrastructure) or [Command Line Interface](http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx)? (They *had* to know it was going to cause confusion using CLI when CLI was already a well-establshed abbreviation.) – Andrew Morton Jul 06 '16 at 17:16
-
Command Line Interface – Sam Jul 06 '16 at 17:17
-
Thanks for clarifying - I thought that *maybe* you wanted to produce a CLI-compliant application/library. – Andrew Morton Jul 06 '16 at 17:20
3 Answers
You can use dotnet cli
for full framework apps and libraries as well. You just need to use the appropriate framework tag - for example "net46"
to target .NET 4.6. You can target multiple frameworks, too:
For example, from my Noda Time library:
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Xml": "",
"System.Numerics": ""
}
},
"netstandard1.1": {
"buildOptions": {
"define": [ "PCL" ]
},
"dependencies": {
"System.Diagnostics.Debug": "4.0.11",
"System.Globalization": "4.0.11",
"System.Linq": "4.1.0",
"System.Resources.ResourceManager": "4.0.1",
"System.Runtime.Extensions": "4.1.0",
"System.Runtime.Numerics": "4.0.1",
"System.Runtime.Serialization.Xml": "4.1.1",
"System.Threading": "4.0.11",
"System.Xml.XmlSerializer": "4.0.11"
}
}
}
The PCL
preprocessor symbol will be renamed to "DOTNET_CORE" or similar at some point - it's only there because I have a bunch of code that uses it for conditional compilation back when I used to target portable class libraries.
You can still also target portable class libraries, by the way... so a single package can target many different versions.

- 1,421,763
- 867
- 9,128
- 9,194
Do I use the CLI if I want to create an ASP.NET Core 1.0 app that uses the .NET Framework?
The .NET CLI is for either, the distinction is actually made in the project.json
file. For example you can use the following command to compile/build the ASP.NET Core application while the application is actually targeting the full-framework:
Here is what an example project.json
would look like targeting .NET 4.6.
{
"frameworks": {
"net46": { }
}
}
For more details I always encourage people to refer to the documentation found here. Likewise, since this is open-source (which is amazing) you can look at the source to understand how it is that this is intended to be used.

- 23,787
- 10
- 79
- 107
CLI is just tooling. What your application will use to run is not coupled to tooling (i.e. as long as the tooling is able to create the correct application for your target framework it does not matter how tooling runs). Rather, in your project.json
file you specify the target framework in form of target framwork moniker (e.g. net451
for .NET Framework 4.5.1 or netcoreapp1.0
for .NET Core apps etc.)

- 31,342
- 4
- 73
- 104
-
Do I need to get the CLI separately or will upgrading to Visual Studio 2015 Update 3 automatically install CLI for me? – Sam Jul 06 '16 at 17:21
-
You need to install web tooling on top of Update3. You can get VS tooling from https://www.microsoft.com/net/download (NET Core Tooling Preview 2 for Visual Studio 2015) – Pawel Jul 06 '16 at 17:22
-
@Sam, this is part of the instructions found here... https://www.microsoft.com/net/core#windows – David Pine Jul 06 '16 at 17:26
-
@DavidPine I was just there and I still have a question. Does installing the .NET Core 1.0 for Visual Studio install everything I need i.e. .NET Core framework, CLI and .NET Core support in Visual Studio? – Sam Jul 06 '16 at 17:29
-
@Sam you need the **.NET Core for Visual Studio** downloadable [here](https://go.microsoft.com/fwlink/?LinkId=817245). First install VS 2015 Update 3, then the CLI as the steps indicate. – David Pine Jul 06 '16 at 17:30