dotnet / EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6
https://docs.microsoft.com/ef/
Creative Commons Attribution 4.0 International
1.59k stars 1.95k forks source link

Example: To enable reverse engineering from an existing database does not work #99

Closed adayIvey closed 8 years ago

adayIvey commented 8 years ago

https://github.com/aspnet/EntityFramework.Docs/blob/master/docs/getting-started/full-dotnet/existing-db.rst

The example to enable reverse engineering from an existing database does not work: Scaffold-DbContext -provider EntityFramework.MicrosoftSqlServer -connection "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;"

when I tried this is vs2015 I get

The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:19

rowanmiller commented 8 years ago

Did you install the EntityFramework.Commands package? That is the package that brings in that command.

BTW, best to view the docs at http://docs.efproject.net/en/latest/ as they are RST. GitHub partially renders them as MarkDown... but you don't get all the content.

adayIvey commented 8 years ago

Yes i did install the commands

Sent from my Samsung device

-------- Original message -------- From: Rowan Miller notifications@github.com Date: 12-23-2015 4:15 PM (GMT-05:00) To: "aspnet/EntityFramework.Docs" EntityFramework.Docs@noreply.github.com Cc: "Day, Andrew" aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

Did you install the EntityFramework.Commands package? That is the package that brings in that command.

BTW, best to view the docs at http://docs.efproject.net/en/latest/ as they are RST. GitHub partially renders them as MarkDown... but you don't get all the content.

Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-166991023.

rowanmiller commented 8 years ago

Couple more questions:

adayIvey commented 8 years ago

I tried this in a class library and a console app.

Using the latest 4.x framework

Sent from my Samsung device

-------- Original message -------- From: Rowan Miller notifications@github.com Date: 12-23-2015 6:24 PM (GMT-05:00) To: "aspnet/EntityFramework.Docs" EntityFramework.Docs@noreply.github.com Cc: "Day, Andrew" aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

Couple more questions:

Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-167008093.

rowanmiller commented 8 years ago

For you, are the steps to reproduce as simple as:

If so, there must be something specific to your installation. A couple of initial questions to help narrow things down:

Also just confirming that these are not ASP.NET 5 class libraries/console apps... since Package Manager Console commands do not work with those project types yet.

adayIvey commented 8 years ago

I will try when i am back in the office in the new year.... thanks

Sent from my Samsung device

-------- Original message -------- From: Rowan Miller notifications@github.com Date: 12-28-2015 3:03 PM (GMT-05:00) To: "aspnet/EntityFramework.Docs" EntityFramework.Docs@noreply.github.com Cc: "Day, Andrew" aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

For you, are the steps to reproduce as simple as:

If so, there must be something specific to your installation. A couple of initial questions to help narrow things down:

Also just confirming that these are not ASP.NET 5 class libraries/console apps... since Package Manager Console commands do not work with those project types yet.

Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-167643390.

AndyFraserABZ commented 8 years ago

I am having exactly the same problems. I have followed the steps above except that I am creating a WinForms application. Get-Execution returns RemoteSigned, I am using VS 2015 version 14.0.24720.00 Update 1.

The only thing of note is that on executing the Install-Package EntityFramework.Commands -Pre command, it shows a Red error "Cannot bind parameter 'FilterScript'..." but continues and eventually says "Successfully installed 'EntityFramework.Commands 7.0.0-rc1-final' to ".

Andy

adayIvey commented 8 years ago

Thanks for your help I am going to give this a try.

I just noticed that my PS Version is only 2.0 should I go to 3.0 for should I go to the latest and greatest.

From: Rowan Miller [mailto:notifications@github.com] Sent: Monday, December 28, 2015 3:04 PM To: aspnet/EntityFramework.Docs EntityFramework.Docs@noreply.github.com Cc: Day, Andrew aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

For you, are the steps to reproduce as simple as:

If so, there must be something specific to your installation. A couple of initial questions to help narrow things down:

Also just confirming that these are not ASP.NET 5 class libraries/console apps... since Package Manager Console commands do not work with those project types yet.

— Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-167643390.

adayIvey commented 8 years ago

Update…

I installed PS v4 amd that looks to have fixed my issue.

But while running Scaffold-DbContext I got error ‘The given key was not present in the dictionary.’

This looks to be a known issue https://github.com/aspnet/EntityFramework/issues/3861 Do you know if there are plans for a rc2 or a work around for this issue?

From: Rowan Miller [mailto:notifications@github.com] Sent: Monday, December 28, 2015 3:04 PM To: aspnet/EntityFramework.Docs EntityFramework.Docs@noreply.github.com Cc: Day, Andrew aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

For you, are the steps to reproduce as simple as:

If so, there must be something specific to your installation. A couple of initial questions to help narrow things down:

Also just confirming that these are not ASP.NET 5 class libraries/console apps... since Package Manager Console commands do not work with those project types yet.

— Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-167643390.

rowanmiller commented 8 years ago

I just noticed that my PS Version is only 2.0 should I go to 3.0 for should I go to the latest and greatest.

I installed PS v4 and that looks to have fixed my issue.

@bricelam we do require PS 3.0 right?

@aday12345 - Regarding #3861 that is fixed and will ship in RC2 (planned for next month). In the meantime you could get out nightly builds that include the fix https://www.myget.org/Gallery/aspnetvnext

adayIvey commented 8 years ago

Thanks for all your help

From: Rowan Miller [mailto:notifications@github.com] Sent: Monday, January 04, 2016 1:32 PM To: aspnet/EntityFramework.Docs EntityFramework.Docs@noreply.github.com Cc: Day, Andrew aday@ivey.uwo.ca Subject: Re: [EntityFramework.Docs] Example: To enable reverse engineering from an existing database does not work (#99)

I just noticed that my PS Version is only 2.0 should I go to 3.0 for should I go to the latest and greatest.

I installed PS v4 and that looks to have fixed my issue.

@bricelamhttps://github.com/bricelam we do require PS 3.0 right?

@aday12345https://github.com/aday12345 - Regarding aspnet/EntityFramework#3861 that is fixed and will ship in RC2 (planned for next month). In the meantime you could get out nightly builds that include the fix https://www.myget.org/Gallery/aspnetvnext

— Reply to this email directly or view it on GitHubhttps://github.com/aspnet/EntityFramework.Docs/issues/99#issuecomment-168761234.

AndyFraserABZ commented 8 years ago

Yes, upgraded to PS4 and all seems to be fine now :-) Many thanks.

Andy

rowanmiller commented 8 years ago

Great - I have https://github.com/aspnet/EntityFramework.Docs/pull/103 our for review to add this as a pre-requisite

rowanmiller commented 8 years ago

Thanks all for your work getting to the bottom of this one

bricelam commented 8 years ago

we do require PS 3.0 right?

Yes, it's required by our module. Our module should fail to load without it; I wonder if the error is getting swallowed/hidden by NuGet...

adayIvey commented 8 years ago

do you know when we will see RC2????

bricelam commented 8 years ago

@aday12345 No, but when we do, it'll be posted here.