TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Emanuele Leoni
NA
139
16.9k
default DbConfiguration instance was used by EntityFramework
Mar 19 2018 4:16 AM
I have a DAL project with this ApplicationContext.cs
[DbConfigurationType(
typeof
(MyConfiguration))]
public
class
ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public
ApplicationDbContext() :
base
(
"DefaultConnection"
, throwIfV1Schema:
false
) { } ...
}
but when I instance it in an other project
using
(var databaseContext =
new
ApplicationDbContext()) { }
I get this error:
The default DbConfiguration instance was used by the Entity Framework before the 'MyConfiguration' type was discovered. An instance of 'MyConfiguration' must be set at application start before using any Entity Framework features or must be registered in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information.
I tried to solve it updating the web.config file, inserting codeConfigurationType in node, but I get the same error.
Can anyone help me?
Reply
Answers (
6
)
IIS 8.5 issues in 2012r2
Error C#: Object Reference Not Set To an Instance Object?