mvc-mini-profiler, entity framework gives: The space 'SSpace' has no associated collection

前端 未结 1 700
[愿得一人]
[愿得一人] 2021-01-23 02:28

I\'m trying to use the mvc-mini-profiler in my mvc application. I created a wrapper for my context and Castle Windsor creates the instance. However, I get the error \"The space

相关标签:
1条回答
  • 2021-01-23 02:56

    Ok, here was my problem: The profiler wants a workspace to make a new profiled connection, the workspace is created through this method (in ObjectContextUtils.cs):

       static MetadataCache()
        {
            workspace  = new System.Data.Metadata.Edm.MetadataWorkspace(
              new string[] { "res://*/" },
              new Assembly[] { typeof(U).Assembly });
        }
    

    As you can see it will search in assembly of the type you want to create. Since in my case the type of the model was not in the same assembly, the creation of the workspace failed. Moving the DigidosEntities to the same assembly as the edmx fixed it.

    0 讨论(0)
提交回复
热议问题