Estoy trabajando con Entity Framework 4 y CTP 4 y realmente me está gustando hasta ahora. Puedo hacer que funcione correctamente cuando uso la Autenticación de Windows para conectarme a la base de datos, pero cuando cambio a la Autenticación SQL, falla con el siguiente mensaje. Le he dado al usuario una función sysadmin y su base de datos predeterminada es master.Code First Entity Framework 4: error con la autenticación SQL
error:
This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection.
¿Alguna idea?
... algo más de detalle de error:
[InvalidOperationException: This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection.]
System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +344
System.Data.SqlClient.SqlProviderServices.DbDatabaseExists(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +231
System.Data.Objects.ObjectContext.DatabaseExists() +84
System.Data.Entity.Internal.DatabaseOperations.Exists(ObjectContext objectContext) +9
System.Data.Entity.Infrastructure.Database.Exists() +53
System.Data.Entity.Infrastructure.RecreateDatabaseIfModelChanges`1.InitializeDatabase(TContext context) +129
System.Data.Entity.Infrastructure.<>c__DisplayClass2`1.<SetInitializer>b__0(DbContext c) +75
System.Data.Entity.Infrastructure.Database.Initialize() +207
System.Data.Entity.Internal.InternalContext.Initialize() +70
System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext() +9
System.Data.Entity.Internal.InternalContext.TryUpdateEntitySetMappingsForType(Type entityType) +51
System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType) +17
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +24
System.Data.Entity.Internal.Linq.EfInternalQuery`1.Initialize() +62
System.Data.Entity.Internal.Linq.EfInternalQuery`1.get_Provider() +9
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +13
System.Linq.Queryable.Select(IQueryable`1 source, Expression`1 selector) +63
Solo sirve para mostrar qué tan "beta" es EF en realidad. "y realmente me gusta hasta ahora" me asusta mucho. –
Excepto si realmente desea QUITARSE si el modelo cambia, o descartar siempre ... este llamador (nulo) lo establece en CreateIfNotExists, siempre. – bc3tech