Imagio / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Exception when using calling Database.SetInitializer #144

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Call Database.SetInitializer(new YourInitializer()) at your DbContext 
constructor
2.You will receive this error: Unable to cast object of type 
'MvcMiniProfiler.Data.EFProfiledDbConnection' to type 
'System.Data.SqlServerCe.SqlCeConnection'

[InvalidCastException: Unable to cast object of type 
'MvcMiniProfiler.Data.EFProfiledDbConnection' to type 
'System.Data.SqlServerCe.SqlCeConnection'.]
   System.Data.SqlServerCe.SqlCeMultiCommand.set_DbConnection(DbConnection value) +26
   System.Data.Common.DbCommand.set_Connection(DbConnection value) +9
   MvcMiniProfiler.Data.ProfiledDbCommand.set_DbConnection(DbConnection value) in C:\Users\sam\Desktop\mvc-mini-profiler\MvcMiniProfiler\Data\ProfiledDbCommand.cs:118
   System.Data.Common.DbCommand.set_Connection(DbConnection value) +9
   System.Data.Common.Utils.CommandHelper.SetStoreProviderCommandState(EntityCommand entityCommand, EntityTransaction entityTransaction, DbCommand storeProviderCommand) +60
   System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +104
   System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +722
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +131
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +36
   System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +179
   System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2(IEnumerable`1 sequence) +41
   System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +59
   System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +133
   System.Data.Entity.Internal.Linq.DbQueryProvider.Execute(Expression expression) +60
   System.Linq.Queryable.SingleOrDefault(IQueryable`1 source, Expression`1 predicate) +287
   FujiyBlog.Core.EntityFramework.FujiyBlogDatabase..ctor() in D:\Meus Arquivos\Desenvolvimento\Projetos\Blog\src\FujiyBlog.Core\EntityFramework\FujiyBlogDatabase.cs:31

Original issue reported on code.google.com by felipepessoto on 10 Mar 2012 at 1:25

GoogleCodeExporter commented 8 years ago
Hmm, actually don´t work with SQL CE at all

Original comment by felipepessoto on 10 Mar 2012 at 1:27

GoogleCodeExporter commented 8 years ago
Do you mind moving this to http://community.miniprofiler.com ... killing off 
google issues

Original comment by sam.saff...@gmail.com on 27 Apr 2012 at 11:40