title: Why does this work when I debug from Visual Studio but doesn't after I deploy to IIS?
body: <p>Ok so this is really becoming frustrating and am hoping that someone can help me with this. I have just started going through some SignalR tutorials and all of that was working great. Then I decided to add an MVC Entity Framework model for some data access to my SignalR project so I could store name and messages that have been send to my test chat message hub.</p>
  
  <p>Here is the frustrating part, this all works great when I run in debug from Visual Studio but as soon as I publish to my IIS server the Entity Framework code in my message hub stops working and throws this Error: ProviderIncompatibleException</p>
  
  <p><strong>Inner Exception:</strong> 
  "{"An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct."}"</p>
  
  <p><strong>Next Inner Exception:</strong>
  {"The provider did not return a ProviderManifestToken string."}</p>
  
  <p><strong>Last Inner Exception:</strong>
  {"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: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.\r\n)"}</p>
  
  <p>This error is thrown on the "db.Database.Initialize(false);" line in my message hub code.</p>
  
  <p>This was frustrating me so much that I was researching these error messages last night until 1:00 am. I would really appreciate ANY help with this. And the most frustrating thing is this code is so simple it should just be working......</p>
  
  <p>Thanks.</p>
  
  <p><strong>Here is the code for my message hub:</strong></p>
  
  <pre><code>public class BPACustomerServiceMessageHub : Hub
  {
  
      public void Send(string name, string message)
      {
          Database.SetInitializer(new CreateDatabaseIfNotExists&lt;MessagesContext&gt;());
          using (MessagesContext db = new MessagesContext())
          {
              db.Database.Initialize(false);
              Messages omsg = new Messages();
              omsg.name = name;
              omsg.message = message;
              db.Messages.Add(omsg);
              db.SaveChanges();
              db.Dispose();
          }
  
  
          // Call the broadcastMessage method to update clients.
          Clients.All.broadcastMessage(name, message);
          SendParams mparams = new SendParams();
          mparams.Name = name;
          mparams.Message = message;
          Clients.All.broadcastMessage2(mparams);
      }
  }
  
  public class SendParams
  {
      public string Name { get; set; }
      public string Message { get; set; }
  
  }
  </code></pre>
  
  <p><strong>Here is the code for my model and context:</strong></p>
  
  <pre><code>public class Messages
  {
      [Key]
      public int id { get; set; }
      public string name { get; set; }
      public string message { get; set; }
  }
  public class MessagesContext : DbContext
  {
      public DbSet&lt;Messages&gt; Messages { get; set; }
  }
  </code></pre>
  
  <p><strong>Here is my connection string from my web.config:</strong></p>
  
  <pre><code>&lt;connectionStrings&gt;
  &lt;add name="MessagesContext" 
       connectionString="Data Source=(LocalDB)\v11.0;
                         database=Messages;
                         AttachDbFilename=|DataDirectory|\Messages.mdf;
                         Initial Catalog=Messages;
                         Integrated Security=True" 
       providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p></p>