Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team

I am having this issue and dont know how to fix it, I have configured my Web.Config file for connection to the Database, the schema is loaded on _AppStart folder on my project and has table fields. Now every time i invoke the register file, i get this exception on ApplicationUser class.

What I have tried:

C#
<pre>using Microsoft.AspNet.Identity.EntityFramework;

namespace ContentManagementSystem.Models
{
    public class ApplicationUser:IdentityUser
    {
        public string Email { get; set; }
        public bool ConfirmedEmail { get; set; }

    }

    public class ApplicationDbContext: IdentityDbContext<ApplicationUser>
    {
        public ApplicationDbContext()
            : base("eNtsaOnlineRegistrationDB")
        {

        }
    }
}


<connectionStrings>
    <add name = "eNtsaOnlineRegistrationDB" connectionString = "Data Source=GcobaniM-L\SQLEXPRESS;AttachDbFilename=[DataDirectory]\eNtsaOnlineRegistrationDB.mdf;Initial Catalog=eNtsaOnlineRegistration;Integrated" Security="True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
Posted
Comments
Richard Deeming 6-Feb-20 8:33am    
The TypeInitializationException will have an InnerException which contains the actual error details.

Without the full details of the exception, there's no way to begin to diagnose what the problem is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900