Возникло исключение: CLR/System.TypeLoadException
Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.dll: 'Could not load type 'System.Data.Common.DbProviderFactories' from assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'
at System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup)
at System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetServices(Type type, Object key)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
at System.Linq.Enumerable.<OfTypeIterator>d__32`1.MoveNext()
at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable`1 ts, Action`1 action)
at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.<.ctor>b__1()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration()
at System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model)
at myweb.DAL.UserContext..ctor() in D:\Programming\csharp\stazh\myweb\DAL\UserContext.cs:line 12
using System;
using System.Collections.Generic;
using System.Web;
using System.Data.Entity;
using myweb.Models;
using System.Data.Entity.ModelConfiguration.Conventions;
namespace myweb.DAL{
public class UserContext : DbContext
{
public UserContext()
:base("UserContext")
{ }
public DbSet<User> Users { get; set; }
}
}
in Visual Studio Code ASP.NET MVC5
Сборка персонального компьютера от Artline: умный выбор для современных пользователей