EF Code First Migrations failure in VS 2022 v17.0.0 P1
See original GitHub issueThis issue has been moved from a ticket on Developer Community.
[severity:I’m unable to use this version] [regression] [worked-in:16.10.2] I’m unable to enable-migrations, add-migration, update-database in vs 2022 v17.0.0 P1. My project is asp.net based, running entity framework, code first migration.
All three of these commands return the following error…
System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2. <.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Value cannot be null.
Parameter name: type``
Original Comments
Feedback Bot on 6/27/2021, 06:55 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Cannot run Add-Migration in Visual Studio 2022, EF6 Code ...
While numerous users have reported upgrading to EF 6.4.4 resolves their problem, the issue is still open, as there are users who can't...
Read more >How to fix EF Core Update Database Migration issue in VS 2022
Unlock the power of Microsoft .NET Core with my engaging Udemy courses! For all the details and limited-time $9.99 pricing, scroll down to ......
Read more >Entity Framework 6 code first migrations fail with msbuild ...
I am using Entity Framework 6 within VS 2017 Enterprise edition. I'm using code first and I have database migrations enabled. In some...
Read more >Tutorial: Use EF Migrations in an ASP.NET MVC app and ...
In this tutorial, you enable Code First migrations and deploy the application to the cloud in Azure.
Read more >Projections of Education Statistics to 2021, Fortieth Edition
The projections presented in this report are based on the. 2000 census and assumptions for the fertility rate, internal migration, net immigration, and ......
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 Free
Top 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
This issue has been closed because EF6 is no longer being actively developed. We are instead focusing on stability of the codebase, which means we will only make changes to address security issues. See the repo README for more information.
Using EF 6.4.4 (NuGet package) in VS 2022 17.0.2 (C#, ASP.NET app) has this issue when attempting to use “add-migration” or “update-database” from Package Manager Console. Get exact error as OP, so this is still happening on absolute latest available builds.
Only “workaround” that works for me is to use VS2019 at this time. Full disclosure: this website was originally created in VS 2017 and EF 6.0.