MiniProfiler 与 EF“模型优先” EDMX模型
我正在尝试让 MiniProfiler 分析我的数据库访问,但遇到了问题。我看到的所有帮助似乎都是针对“代码优先”实体框架连接。我的模型是在今年代码首次更新可用之前设计的,我使用设计器创建了 edmx 模型。 (我已经使用它近一年了,它似乎对我有用)
MiniProfiler 文档网站上的示例对我来说没有意义。我尝试了一些变体,但遇到了问题。
我的模型称为 CYEntities,通常要实例化一个 ObjectContext 我只是这样做 var context = new CYEntities()
这是我为探查器所做的尝试...
var dbConnection = new CYEntities().Connection;
var profiledConnection = ProfiledDbConnection.Get(dbConnection);
var context = profiledConnection.CreateObjectContext<CYEntities>(); // this is the context I'd finally use to access data.
这会引发异常...
System.ArgumentException:无法找到请求的 .Net Framework 数据提供程序。它可能未安装。
我不知道该去哪里。
I'm trying to get MiniProfiler to profile my database access but I'm running into problems. All the help I see out there seems to be for "code first" entity framework connections. My model was designed before the code first update was available this year and I used the designer to create the edmx model. (I've been using this for almost a year and it seems to be working for me)
The example on the MiniProfiler documentation site doesn't make sense to me. I've tried a few variations of it but I'm having problems.
My Model is called CYEntities, normally to instantiate an ObjectContext I just do thisvar context = new CYEntities()
here's what I've tried for the profiler...
var dbConnection = new CYEntities().Connection;
var profiledConnection = ProfiledDbConnection.Get(dbConnection);
var context = profiledConnection.CreateObjectContext<CYEntities>(); // this is the context I'd finally use to access data.
This throws an exception...
System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
I'm not sure where to go from here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样:
Try like this:
我也有同样的问题。看来您必须将以下内容添加到您的 web.config 中,但是,对我来说,这会导致 w3wp.exe 进程崩溃(以及 Visual Studio 中的 Web 服务器,用于本地请求)。这似乎不会发生在其他人身上,因此它可能对您有用(请确保插入您正在使用的探查器的实际版本)。
I'm having the same issue. It appears that you must add the following to your web.config, however, for me this causes the w3wp.exe process to crash (and the web server in visual studio, for local requests). It doesn't seem like something that is happening to anyone else, so it might work for you (make sure to insert the actual version of the profiler you are using).