Alright, I have googled this all morning and I can really use some help. I am following along a book by Adam Freeman (Pro ASP.Net MVC 4) and I am stuck in Chapter 7. BTW, I am not sure why Apress does not have support forum like Wrox where authors can help people get unstuck with examples in their book.
Anyway, the book used a database first to EF, following the book, I created a localDB, defined DB schema and added some sample data.Then created this DBcontext
using System.Data.Entity;
using SportsStore.Domain.Entities;
namespace SportsStore.Domain.Concrete
{
class EFDbContext : DbContext
{
public DbSet<Product> Products { get; set; }
}
}
And then here is the connection string
<connectionStrings>
<add name="EFDbContext" connectionString="Data Source=(localdb)\v11.0;Initial Catalog=SportsStore;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
And also, here is some settings that I guess was auto added by EF/Nuget during installation
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
The error message is all over the place, as I keep messing wit it, the error messages keep changing but they all point to something about Entity Framework. Please help, any assistance is greatly appreciated so I can proceed with my self study.
The current error message is "The configuration section 'entityFramework' cannot be read because it is missing a section declaration"
Config Source:
96: </runtime>
97: <entityFramework>
98: <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<section name="entityFramework"inside yourconfigSections? See my answer for the relevant bits from a sample config file.