Commands: .NET Core CLI Implementation
See original GitHub issueDNX commands will be going away with the transition to .NET Core CLI. We’ll need to create a .NET Core CLI tools package instead. Like the NuGet PMC commands, any version of the command should be able to work with any version of the framework.
Known Issues
- System.DllNotFoundException: Unable to load DLL ‘sni.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E) (#4953)
- Unable to load DLL ‘sqlite3’: The specified module could not be found. (Exception from HRESULT: 0x8007007E) (dotnet/cli#2289)
- Could not load file or assembly ‘System.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. (dotnet/cli#2289)
- Support netcoreapp1.0 apps
- Hosting environment not setup correctly. https://github.com/aspnet/EntityFramework/issues/5065
- Newtonsoft.Json 7.0.0 missing at runtime https://github.com/NuGet/Home/issues/2462
- Newtonsoft.Json 8.0.0 could not be loaded at runtime https://github.com/dotnet/cli/issues/2514. Workaround in #5082
-
Tools using ConfigurationBuilder without setting basepath cannot find config files.won’t fix. User’s need to set base path toIHostingEnvironment.ContentRootPath
. - Need to change to nested-dispatch model because
AssemblyLoadContext
does not provide the necessary isolation https://github.com/dotnet/cli/issues/2514 - Cannot use dotnet-ef on a netstandard library or standalone app with nested-dispatch https://github.com/dotnet/cli/issues/2645
Usage
Your project.json
should look something like this.
{
"compilationOptions": {
"emitEntryPoint": true
},
"tools": {
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-*",
"imports": "portable-net452+win81"
}
},
"dependencies": {
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0-*",
"Microsoft.EntityFrameworkCore.Sqlite.Design": { "version": "1.0.0-*", "type": "build" },
"Microsoft.EntityFrameworkCore.Tools": { "version": "1.0.0-*", "type": "build" }
},
"frameworks": {
"netcoreapp1.0": {
"imports": "portable-net452+win81",
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}
}
}
}
Your workflow will look something like this.
dotnet restore
cd src\MyProject
dotnet ef migrations add MyMigration
dotnet ef database update
Issue Analytics
- State:
- Created 8 years ago
- Comments:51 (26 by maintainers)
Top Results From Across the Web
NET CLI overview
The .NET command-line interface (CLI) is a cross-platform toolchain for developing, building, running, and publishing .NET applications. The .
Read more >.NET Core Command-line Interface
The .NET Core command-line interface (CLI) is a new cross-platform tool for creating, restoring packages, building, running and publishing .NET applications ...
Read more >Build a Command Line Interface(CLI) Program with .NET ...
For our CLI program, we implement two sub commands for the first version. orderhub login. orderhub list-tickets. login will allow user login with...
Read more >.NET Core CLI
The .NET Core command-line interface (CLI) is a cross-platform for developing, building, running, and publishing .NET Core applications.
Read more >ASP.NET Core Command Line Interface
NET Core CLI (Command Line Interface) is a new cross-platform tool that is used for creating, restoring packages, building, running, and publishing ASP.NET...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Blocked on https://github.com/dotnet/cli/issues/2289. The issue: sqlite3.dll and sni.dll are not included in the AssemblyLoadContext, so any calls to actually connect to the database fail.
Might just be the TFM change, but latest cli doesn’t even find dotnet-ef. 😢
Using 1.0.0-beta-001937