question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Commands: .NET Core CLI Implementation

See original GitHub issue

DNX 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 to IHostingEnvironment.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:closed
  • Created 8 years ago
  • Comments:51 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
natemcmastercommented, Apr 7, 2016

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.

1reaction
natemcmastercommented, Mar 22, 2016

Might just be the TFM change, but latest cli doesn’t even find dotnet-ef. 😢

No executable found matching command "dotnet-ef"

Using 1.0.0-beta-001937

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found