-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaffold-DbContext PMC Command doesn't work (Bug) #15414
Comments
Pls share your csproj file contents |
Note for triage: I was able to reproduce this. //cc @bricelam @divega Additional info:
Stack:
csproj: <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview4-19216-03" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview4.19216.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="3.0.0-preview4.19216.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview4.19216.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project> |
Got the same problem:
csproj: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-preview4.19216.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="3.0.0-preview4.19216.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0-preview4.19216.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview4.19216.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview4.19216.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0-preview4.19212.13" />
</ItemGroup>
</Project> |
This is my csproj:
My IDE version: (RTM)
|
@ajcvickers ,, I did it exactly as you suggested. The difference is only in the csproj configuration, I created a project API, so I don't need to add this script:
|
By making the base classes abstract and never registering them as defaults in D.I. Fixes #15414
By making the base classes abstract and never registering them as defaults in D.I. Fixes #15414
Is there a fix for this? I have the same issue by just creating a stock VS2019 ASP Net MVC Core 3.0 preview project and trying to scaffold a database first model. |
@myblindy It is fixed for next preview. You could try the nightly builds using the feeds listed on the homepaage if you need the fix before then. However, note that the fix may not yet have propagated to the nightlies. |
Oh this is pain... manually creating scaffolding takes me back to the day (last week) when I was manually fixing EF6 entries for Oracle database entities... latest preview 5 still broken. |
Yes, |
@guidevnet I can't say anything about when preview5 will be released even though we have branched for it. |
@guidevnet Maybe in connection with an upcoming event? |
@guidevnet I'd be interested more in knowing how you're using the previews that makes this a long wait, and yet at the same time the nightlies are not an option. (I'm not trying to imply you're doing something wrong, but it's an unusual position and I would like to understand it better so we can make sure we're doing the right thing with previews.) |
@ajcvickers Yes, you are doing the right thing with previews - this is my fault. My team is developing a software to be released around October, and I choose to implement in .Net Core 3 (of course assuming that we would get some breaking changes along the road). |
@guidevnet Thanks for the info. |
I'm in the same position, pushed Blazor onto my team for a software release in late October but little issues like this make it difficult, using nightlies makes early UAT complicated when you don't know what will break when, only that something will break :) |
@PeaStew Yeah, me too using blazor! (server-side). Ha, this is Microsoft's fault: if the new products where less awesome, we wouldn't bother using EF6 and MVC. |
100%... I'm back to being a full-stack developer again, I was pushing all the Javascript off to team members because I hate it so much ;) |
I'm trying to get preview5 working due to this error, but can't get that working either. I'm working on a fresh project file (I've tried 7 variants today) to post in a bit. |
@jbrown-jane-com Can you post you csproj file? |
Please post your csproj file... |
Here is my version 4 project that gives me the same errors listed in this feed. no suprises of course. Here is my version 5 project that has build errors (listed below). TestEF8-Version5-BuildErrors.zip Here are the errors: Severity Code Description Project File Line Suppression State |
Please keep in mind I have tried many variants of this. Starting with version5, starting with 4 and upgrading, using packagereferences, using install from package manager console. I have yet to get all the preview5 packages to work together. Hence my request for simple steps to get EF working with preview5. |
Interesting to note that my preview5 version of the project has all 5's in the project file but I get this: You will note that the last NuGet package DotNetAppHost does not show preview5 even though I ran the install tool and put in the package ref. It keeps getting changed back when I install Platforms release5 or SqlServer release5. Hopefully that gives you enough info. |
The project has nothing confidential in it, I can upload the entire folder if need be. |
@skwork34 You should try uninstalling all nuget packages, and then install all from scratch in version 5 (instead of upgrading it). The last package of your nuget folder is in preview 4, it seems like a dependency of other packages. |
I've done that. That's the first route I took. It dies on installing the Microsoft.EntityFrameworkCore.SqlServer. That one gives the same error. But I can try again. Test #9 coming up. haha :) Thanks to all who looked at it. I have no doubt it is just some wrong step I take. Is there anyone out there that has preview5 working from a scratch project that does scaffolding of an existing db? Did you use package manager to install, the manager console and install commands, or did you simply add PackageReferences in the project file? Any ideas would help. :) |
Found the issue: I mistakenly thought the latest update of visual studio that hit with the preview5 announcment had the preview5 .net core sdk with it. @guidevnet 's comment triggered the thought of downloading the sdk again and installing it and wham, it all works. Thanks for the triggering suggestion, and thanks to all who helped. |
Reverse engineer doesn't work and displays an error message on the console.
PMC Command:
If you are seeing an exception, include the full exceptions details (message and stack trace).
Steps to reproduce
In the previous version, a procedure like this still works. Am I missing something?
Further technical details
EF Core version: 3.0.0-preview4.19216.3
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Ms. Windows 10
IDE: Visual Studio 2019 16.0.2
The text was updated successfully, but these errors were encountered: