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

大憨熊 提交于 2019-12-02 02:07:32

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!