Não consigo rodar a aplicação, dá erro na linha
EntidadesContext contexto = new EntidadesContext();
Este é o texto da exception:
System.TypeLoadException was unhandled
HResult=-2146233054
Message=Não foi possível carregar o tipo Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions do assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60.
Source=EntityFramework.Core
TypeName=Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions
StackTrace:
em Microsoft.Data.Entity.DbContext.GetOptions(IServiceProvider serviceProvider)
em Microsoft.Data.Entity.DbContext..ctor()
em lojaComEntity.EntidadesContext..ctor()
em lojaComEntity.Program.Main(String[] args) na D:\_Documentos\Visual Studio 2015\Projects\lojaComEntity\lojaComEntity\Program.cs:linha 14
em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ThreadHelper.ThreadStart_Context(Object state)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()
InnerException:
Não consegui usar o comando "Add-Migration criaUsuario" e criei a tabela na mão, ao rodar o comando "Add-Migration criaUsuario", surgiu o seguinte erro:
PM> Add-Migration criaUsuario
System.TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
at Microsoft.Data.Entity.Design.Internal.StartupInvoker.ConfigureServices()
at Microsoft.Data.Entity.Design.DbContextOperations..ctor(ILoggerProvider loggerProvider, String assemblyName, String startupAssemblyName, String environment)
at Microsoft.Data.Entity.Design.MigrationsOperations..ctor(ILoggerProvider loggerProvider, String assemblyName, String startupAssemblyName, String environment, String projectDir, String rootNamespace)
at Microsoft.Data.Entity.Design.OperationExecutor.<>c__DisplayClass3_0.<.ctor>b__3()
at Microsoft.Data.Entity.Internal.LazyRef`1.get_Value()
at Microsoft.Data.Entity.Design.OperationExecutor.<AddMigrationImpl>d__7.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.<>c__DisplayClass4_0`1.<Execute>b__0()
at Microsoft.Data.Entity.Design.OperationExecutor.OperationBase.Execute(Action action)
Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
PM>