I replaced the auto-created aspnet-myproject-20130130223621.mdf and it's ldf files with the files from another project. It didn't work so I deleted these two files and hope the Asp.Net can re-create these two files. I always get the following error Exception in the following function.
- Is it possible to replace the auto-generated Sql server localDB files with existed database files?
- How to let Asp.net recreate these database files?
Exception on:
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
// Ensure ASP.NET Simple Membership is initialized only once per app start
LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
}
Exception message:
{"Exception has been thrown by the target of an invocation."}
InnerException message:
{"Cannot attach the file 'c:\users\nick\documents\visual studio 2012\Projects\MyProject\MyProject\App_Data\aspnet-MyProject-20130130223621.mdf' as database 'aspnet-MyProject-20130130223621'."}