EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Fix ASP.NET Core tutorials to use Preview3 tooling packages

Open Potmos opened this issue 10 years ago • 6 comments

I am having problems following the tutorial at https://github.com/aspnet/EntityFramework.Docs/blob/master/entity-framework/core/get-started/aspnetcore/new-db.md

The Add-Migration command returns to me with: Cannot execute this command because Microsoft.EntityFrameworkCore.Design is not installed. Install the version of that package that matches the installed version of Microsoft.EntityFrameworkCore and try again.

If I then add the Microsoft.EntityFrameworkCore.Design package to the project I still get the same error. The main problem seems to be incompatible between Tools and Design version, I was able to set both to 1.0.0-preview2-final and the Add-Migration Command worked just fine. But it is weird that I am unable to use the latest version of the Design package, removing the tools reference also doesn't seems to solve the problem since if I do that I only get a new error.

The main problema that I face is that, thought I was able to complete the demo, if I try to do the same in my project having the Context in a library instead of my Web Application, I am unable to reference the preview 2 since its incompatible with the NetStandardLibrary 1.6.

Potmos avatar Nov 04 '16 17:11 Potmos

What version of the runtime are you using? 1.0.1?

rowanmiller avatar Nov 04 '16 17:11 rowanmiller

Runtime is 4.1.0 NetCoreApp and almost all others Core Library are 1.0.1 I am attaching the projects file I am using. The one marked as "working" is my Web application, it works on preview 2 if I change for the latest vesion of either the Tools or Design packages it doesn't work anymore.

The other one is for my library where I wish to package my Context project.json.txt working-project.json.txt

.

Potmos avatar Nov 04 '16 17:11 Potmos

Ah, here is what you want...

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview3-final",
    "Microsoft.EntityFrameworkCore.Design": "1.0.1",
    "Entities": "1.0.0-*"
  },
  "tools": {
    "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.0.0-preview3-final"
  },
  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

Note the SQL Server package is 1.0.1 and the package in tools has a .DotNet on the end of it. This set of releases has been problematic as we haven't updated the docs to 1.1 as it is still pre-release, but the there is no stable release of the tooling, so we really needed to update the docs to work with tooling Preview3. I will fix that.

rowanmiller avatar Nov 04 '16 20:11 rowanmiller

Sorry I was off from work and only now saw your message.

With the project you suggested I got the error Cannot execute this command because 'Microsoft.EntityFrameworkCore.Tools' is not installed in project 'Presentation.Web'. Add 'Microsoft.EntityFrameworkCore.Tools' to the 'tools' section in project.json. See http://go.microsoft.com/fwlink/?LinkId=798221 for more details. I then added the Tools.DotNet as a reference and got: Tools.DotNet 1.0.0-preview-final does not support framework .NETStandard 1.6.

Potmos avatar Nov 05 '16 03:11 Potmos

@Potmos can you open an issue on the product repository and include your current project.json https://github.com/aspnet/EntityFramework. This is sounding like a product issue rather than a documentation issue now.

rowanmiller avatar Nov 05 '16 16:11 rowanmiller

Okay, thanks a lot for the help.

Potmos avatar Nov 07 '16 13:11 Potmos