Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8959585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:28:36+00:00 2026-06-15T15:28:36+00:00

In VS 2012 I created a new MVC 4 project starting from the internet

  • 0

In VS 2012 I created a new MVC 4 project starting from the internet application template, then changed its properties to use SQL Server Express instead of LocalDB, then tried successfully to register a new user.

First, the project created its own membership database in the App_data folder, but for deployment reasons I wanted to change the database location, so I moved the database physical files from C:\MyProject\App_Data\ to C:\MyData and modified the related path in the web.config file. To ensure that the database is reachable by the SQL Server Express instance, I added my own user account with full access in the properties security tab, then successfully shown its data in SQL Server Management Studio.

Now, when I run the project, and click on the “log in” link, the debugger stops at LazyInitializer.EnsureInitialized and fails with an error; the inner exception of the error message says:

Database
‘C:\MyProject\App_Data\aspnet-MyProject-20121206123456.mdf’ already
exists. Choose a different database name.
Cannot attach the file ‘C:\MyData\aspnet-MyProject-20121206123456.mdf’ as database
‘aspnet-MyProject-20121206123456.mdf’

I checked all the project to find any different database connection settings but found nothing.

Within VS, when I use the server explorer to view the database tables data, I cannot find “show data” option when I right click on one of the displayed tables, when I go to C:\MyData\ folder to see the physical database files properties, in the security tab, I find that each time I run the project my account using full access was removed.

Also the browser is displaying the next Exception text:

The data provider. Net Framework requested was not found. It may not be installed.

C:\MyProject\Filters\InitializeSimpleMembershipAttribute.cs Ligne : 42

Ligne 40 :                 }
Ligne 41 : 
Ligne 42 :                     WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);
Ligne 43 :                 }
Ligne 44 :                 catch (Exception ex)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:28:37+00:00Added an answer on June 15, 2026 at 3:28 pm

    It looks like a Visual Studio 2012 bug which doesn’t recognize SQL Server 2012 Express instance. I have downloaded Microsoft WebMatrix2 and used it to load the website and could successfully log in using the moved membership database.

    With this bug I’ve lost 2 days trying to find a solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a brand new MVC 4 application in C# using Visual Studio 2012.
Using Visual Studio 2012, I created a new ASP.NET MVC 4 web project, using
I've created a new ASP.Net MVC 4 project in Visual Studio 2012 and figured
When I create a new ASP.Net MVC 4 project with Visual Studio 2012 it
When I create a new WPF application in Visual Studio 2012 the platform target
From the following json snippet: cbfunc22({ query: { count: 2, created: 2012-06-18T11:18:15Z, lang: en-US,
I use Windows Server 2008 R2, IIS 7.0. I downloaded umbraco5 sources, created new
I just created a new application on AppHarbor and pushed a solution containing an
I just opened VS 2012 and created a class library project. After that I
Ok, so I am relatively new to Zend. I have created a new application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.