title: TargetInvocationException thrown in mvc4 internet default application
body: <p>I just made a new <code>ASP.net MVC4</code> internet application in <code>VS2010</code>. While clicking on <strong>register</strong> or <strong>login</strong>  links, browser throughs an exception(please see below). I did not make a single change in the code. I have new installation of <code>Vislual Studio Professional 2010</code>. In previous installation everything was working correct. </p>
  
  <p>Exception is thrown at the line of code</p>
  
  <pre><code>LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref     
  _initializerLock);
  </code></pre>
  
  <p>and detailed method is here</p>
  
  <pre><code>namespace MvcApplication1.Filters
  {
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple   
  =       false, Inherited = true)]
  public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute
  {
      private static SimpleMembershipInitializer _initializer;
      private static object _initializerLock = new object();
      private static bool _isInitialized;
  
      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);
      }
  
      private class SimpleMembershipInitializer
      {
          public SimpleMembershipInitializer()
          {
              Database.SetInitializer&lt;UsersContext&gt;(null);
  
              try
              {
                  using (var context = new UsersContext())
                  {
                      if (!context.Database.Exists())
                      {
                          // Create the SimpleMembership database without Entity      
  Framework migration schema
  
  ((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
                      }
                  }
  </code></pre>
  
  <p>Detail of exception is </p>
  
  <pre><code>Server Error in '/' Application.
  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: 26 - Error Locating 
  Server/Instance Specified)
  Description: An unhandled exception occurred during the execution of the current web  
  request. Please review the stack trace for more information about the error and  
  where it originated in the code.
  
  Exception Details: System.Data.SqlClient.SqlException: 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: 26 - Error Locating Server/Instance Specified)
  </code></pre>