title: EF model not updated in azure?
body: <p>I have set up a working asp.net mvc6 web-app in azure using an SQL database and EF (db-first). Everything worked fine untill I added some columns and tables to the database. After regenerating the model everything still works fine on my local machine, but after publishing the app and updating the database in azure (using SQLAzureMW) the new columns do not seem to exist in the model, because I get the error "invalid column name" for 10 columns. The pages that are using unaltered tables are still working</p>
  
  <p>I checked my connectionstrings in the remote view of my Web.config file after connecting to my azure account in visual studio and they seem fine to me:</p>
  
  <pre><code>&lt;add name="DefaultConnection" 
       connectionString="Data Source=tcp:      &lt;hidden&gt;.database.windows.net,1433;Initial Catalog=datatheek7;User ID=&lt;hidden&gt;;Password=&lt;hidden&gt;" providerName="System.Data.SqlClient" /&gt;
  
  
  &lt;add name="datatheek7Entities" 
     connectionString="metadata=res://*/Models.datatheek7Entities.csdl|res://*/Models    .datatheek7Entities.ssdl|res://*/Models.datatheek7Entities.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=tcp:&lt;hidden&gt;.database.windows.net,1433;Initial Catalog=datatheek7;User ID=&lt;hidden&gt;;Password=&lt;hidden&gt;;" providerName="System.Data.EntityClient" /&gt;&lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Also the newly added columns and tables are visible when I connect to the database on azure in SSMS and I can see the correct edmx.diagram file in the models folder in azure. I that folder I also saw another edmx.diagram with the name of the project (in my case datatheek2.edmx.diagram). Because I suspected the application to still use that initial edmx diagram I just deleted it, but it didn't make any difference. </p>
  
  <p>Anybody any idea's? It would be much appreciated!</p>
  
  <p>For clarity the complete stack trace added below (excuse my formatting):</p>
  
  <blockquote>
    <p>[SqlException (0x80131904): Invalid column name 'SignalsComplete'.
    Invalid column name 'AmountWMG'. Invalid column name
    'PrescriptionsCheckedBy'. Invalid column name
    'PrescriptionsSubmitUserId'. Invalid column name
    'PrescriptionsSubmitDate'. Invalid column name 'SignalsComplete'.
    Invalid column name 'TimeUntill'. Invalid column name
    'SignalsCheckedBy'. Invalid column name 'SignalsSubmitUserId'. Invalid
    column name 'SignalsSubmitDate'.]<br>
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
    Boolean breakConnection, Action<code>1 wrapCloseInAction) +2418094<br>
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection, Action</code>1 wrapCloseInAction)
        +5694436    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285<br>
    System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior,
    SqlCommand cmdHandler, SqlDataReader dataStream,
    BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
    stateObj, Boolean&amp; dataReady) +3731<br>
    System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58<br>
    System.Data.SqlClient.SqlDataReader.get_MetaData() +89<br>
    System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
    RunBehavior runBehavior, String resetOptionsString) +379<br>
    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
    async, Int32 timeout, Task&amp; task, Boolean asyncWrite, SqlDataReader
    ds, Boolean describeParameterEncryptionRequest) +2064<br>
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
    method, TaskCompletionSource<code>1 completion, Int32 timeout, Task&amp; task,
    Boolean asyncWrite) +375<br>
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
    method) +53<br>
    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
    behavior, String method) +240<br>
    System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
    behavior) +41<br>
    System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
        +12    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;Reader&gt;b__c(DbCommand
    t, DbCommandInterceptionContext</code>1 c) +9<br>
    System.Data.Entity.Infrastructure.Interception.InternalDispatcher<code>1.Dispatch(TTarget
    target, Func</code>3 operation, TInterceptionContext interceptionContext,
    Action<code>3 executing, Action</code>3 executed) +72<br>
    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand
    command, DbCommandInterceptionContext interceptionContext) +356<br>
    System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior
    behavior) +166<br>
    System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
        +12    System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand
    entityCommand, CommandBehavior behavior) +37</p>
  
  <pre><code>[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for
  </code></pre>
    
    <p>details.]<br>
    System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand
    entityCommand, CommandBehavior behavior) +112<br>
    System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext
    context, ObjectParameterCollection parameterValues) +744<br>
    System.Data.Entity.Core.Objects.&lt;>c__DisplayClass7.b__6()
        +109    System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction(Func<code>1
    func, IDbExecutionStrategy executionStrategy, Boolean
    startLocalTransaction, Boolean releaseConnectionOnSuccess) +288<br>
    System.Data.Entity.Core.Objects.&lt;&gt;c__DisplayClass7.&lt;GetResults&gt;b__5()
        +142    System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func</code>1
    operation) +189<br>
    System.Data.Entity.Core.Objects.ObjectQuery<code>1.GetResults(Nullable</code>1
    forMergeOption) +279<br>
    System.Data.Entity.Core.Objects.ObjectQuery<code>1.&lt;System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator&gt;b__0()
        +11    System.Data.Entity.Internal.LazyEnumerator</code>1.MoveNext() +45    System.Collections.Generic.List<code>1..ctor(IEnumerable</code>1 collection) +387
    System.Linq.Enumerable.ToList(IEnumerable<code>1 source) +58<br>
    datatheek2.Controllers.BatchesController.Index() in
    C:\Users\Arne\Documents\Visual Studio
    2015\Projects\datatheek2\datatheek2\Controllers\BatchesController.cs:45
    lambda_method(Closure , ControllerBase , Object[] ) +62<br>
    System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase
    controller, Object[] parameters) +14<br>
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
    controllerContext, IDictionary</code>2 parameters) +157<br>
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
    controllerContext, ActionDescriptor actionDescriptor, IDictionary<code>2
    parameters) +27<br>
    System.Web.Mvc.Async.AsyncControllerActionInvoker.&lt;BeginInvokeSynchronousActionMethod&gt;b__39(IAsyncResult
    asyncResult, ActionInvocation innerInvokeState) +22<br>
    System.Web.Mvc.Async.WrappedAsyncResult</code>2.CallEndDelegate(IAsyncResult
    asyncResult) +29<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +49<br>
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult
    asyncResult) +49<br>
    System.Web.Mvc.Async.AsyncInvocationWithFilters.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3d()
        +50    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass46.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3f()
        +225    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass33.&lt;BeginInvokeActionMethodWithFilters&gt;b__32(IAsyncResult asyncResult) +10<br>
    System.Web.Mvc.Async.WrappedAsyncResult</code>1.CallEndDelegate(IAsyncResult
    asyncResult) +10<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +49<br>
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult
    asyncResult) +49<br>
    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass2b.&lt;BeginInvokeAction&gt;b__1c()
        +26    System.Web.Mvc.Async.&lt;&gt;c__DisplayClass21.&lt;BeginInvokeAction&gt;b__1e(IAsyncResult
    asyncResult) +100<br>
    System.Web.Mvc.Async.WrappedAsyncResult</code>1.CallEndDelegate(IAsyncResult
    asyncResult) +10<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +49<br>
    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult
    asyncResult) +44<br>
    System.Web.Mvc.Controller.&lt;BeginExecuteCore&gt;b__1d(IAsyncResult
    asyncResult, ExecuteCoreState innerState) +13<br>
    System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
    asyncResult) +29<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +49<br>
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +55
    System.Web.Mvc.Controller.&lt;BeginExecute&gt;b__15(IAsyncResult
    asyncResult, Controller controller) +12<br>
    System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
    asyncResult) +22<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase<code>1.End() +49<br>
    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +45<br>
    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult
    asyncResult) +10<br>
    System.Web.Mvc.MvcHandler.&lt;BeginProcessRequest&gt;b__5(IAsyncResult
    asyncResult, ProcessRequestState innerState) +21<br>
    System.Web.Mvc.Async.WrappedAsyncVoid</code>1.CallEndDelegate(IAsyncResult
    asyncResult) +29<br>
    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49<br>
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
        +28    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult
    result) +9<br>
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
        +545    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155</p>
  </blockquote>