The system cannot find the file specified during webhosting RRS feed

  • Question

  • User13364659 posted

    I am using asp.net identity with EF data first approach. I have hosted my website on appharbor. All of my controllers actions and webapi is working fine except AccountController. When a user tries to signup it gives the Internal server error. The details of error is: 

    [Win32Exception (0x80004005): The system cannot find the file specified]
    [SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

    My AccountController is:

        public class AccountController : Controller
            private Entities db = new Entities();
            public AccountController()
                : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext())))
            public async Task<JsonResult> RegisterUser(string email, string password = "aa")
                var roleManager = new RoleManager<Microsoft.AspNet.Identity.EntityFramework.IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));
                if (!roleManager.RoleExists("Admin"))
                    var role = new Microsoft.AspNet.Identity.EntityFramework.IdentityRole();
                    role.Name = "Admin";
                var ab = email.Split('@');
                var user = new ApplicationUser() { UserName = email };
                user.Email = ab[0];
                UserManager.PasswordValidator = new PasswordValidator
                    RequiredLength = -1
                var result = await UserManager.CreateAsync(user, password);
                if (result.Succeeded)
                    var currentUser = UserManager.FindByName(user.UserName);
                    var roleresult = UserManager.AddToRole(currentUser.Id, "Admin");
                    try { 
                    await SignInAsync(user, isPersistent: true);
                    catch (Exception e)
                        string s = e.ToString();
                    var id = user.Id;
                    var data =await db.AspNetUsers.FindAsync(id);
                    if (password == "aa")
                        data.IsPasswordSaved = false;
                        data.IsPasswordSaved = true;
                    db.Entry(data).State = System.Data.Entity.EntityState.Modified;
                    await db.SaveChangesAsync();
                    return Json("Done", JsonRequestBehavior.AllowGet);
                return Json("Error", JsonRequestBehavior.AllowGet);

    I have tried to enable remote connections from this answer. But in SQL Server Configuration Manager the SQL Server Network Configuration does not has the option Protocols for SQLEXPRESS. How can I tackle this issue?

    Saturday, February 20, 2016 7:59 AM


All replies