Skip to content
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

dotnet ef database update fails unable to load Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions #56

Closed
akuseru opened this issue Jun 28, 2016 · 7 comments

Comments

@akuseru
Copy link

akuseru commented Jun 28, 2016

This is possibly related to #48 & npgsql/npgsql#1171 however after updating npgsql to 3.1.5 I am still seeing the following:

System.TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Microsoft.Extensions.DependencyInjection.NpgsqlEntityFrameworkServicesBuilderExtensions.AddEntityFrameworkNpgsql(IServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>b__1(Int64 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.EntityFrameworkCore.DbContext..ctor(DbContextOptions options)
   at Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext`1..ctor(DbContextOptions options)
   at forceweb.Data.ApplicationDbContext..ctor(DbContextOptions`1 options) in /Users/adam/git/forceweb/Data/ApplicationDbContext.cs:line 14
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.EntityFrameworkCore.Design.DbContextOperations.<>c__DisplayClass13_2.<FindContextTypes>b__6()
   at Microsoft.EntityFrameworkCore.Design.DbContextOperations.CreateContext(Func`1 factory)
   at Microsoft.EntityFrameworkCore.Design.DbContextOperations.CreateContext(String contextType)
   at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Tools.Cli.DatabaseUpdateCommand.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)
Could not load type 'Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

perhaps waiting on a version bump to Npgsql.EntityFrameworkCore.PostgreSQL?

@ghost
Copy link

ghost commented Jun 29, 2016

#54

@allangomessl
Copy link

@akuseru this error occurs because the class ServiceCollectionExtensions was renamed in Dependency.Injection RTM Version.
Then wait for update version of Npgsql.EntityFrameworkCore.PostgreSQL for RTM Version

@akuseru
Copy link
Author

akuseru commented Jun 29, 2016

Thanks 👍

@akuseru akuseru closed this as completed Jun 29, 2016
@roji
Copy link
Member

roji commented Jun 29, 2016

Can you confirm whether you're still seeing this using Npgsql.EntityFrameworkCore.PostgreSQL 1.0.0 (just released) and Npgsql 3.1.5?

@julielerman
Copy link

wahoo!
2016-06-29_20-03-49
so far so good. My app is running, building a db, populating it and I can interact.
Thanks for doing that so quickly! :)

@akuseru
Copy link
Author

akuseru commented Jun 30, 2016

no issues here either. Thank you!

@ghost
Copy link

ghost commented Jun 30, 2016

Thanks for the fast hard work roji.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants