Entity framework EF db的mvc迷你探查器设置-第一个
我正在尝试将迷你探查器与旧式EF代码一起使用-首先是数据库 到目前为止:Entity framework EF db的mvc迷你探查器设置-第一个,entity-framework,mvc-mini-profiler,Entity Framework,Mvc Mini Profiler,我正在尝试将迷你探查器与旧式EF代码一起使用-首先是数据库 到目前为止: 我使用以下方法创建了一个db上下文: string connectionString = GetConnectionString(); var connection = new EntityConnection(connectionString); var profiledConnection = ProfiledDbConnection.Get(connection); _context
- 我使用以下方法创建了一个db上下文:
string connectionString = GetConnectionString(); var connection = new EntityConnection(connectionString); var profiledConnection = ProfiledDbConnection.Get(connection); _context = profiledConnection.CreateObjectContext<MyEntitiesType>();
string connectionString=GetConnectionString(); var连接=新的实体连接(connectionString); var profiledConnection=ProfiledDbConnection.Get(连接); _context=profiledConnection.CreateObjectContext();
- 但随后我遇到了一个“无法找到请求的.Net Framework数据提供程序。它可能未安装。”
我使用对MvcMiniProfiler提供程序的
引用解决了这个问题:<system.data> <DbProviderFactories> <remove invariant="MvcMiniProfiler.Data.ProfiledDbProvider" /> <add name="MvcMiniProfiler.Data.ProfiledDbProvider" invariant="MvcMiniProfiler.Data.ProfiledDbProvider" description="MvcMiniProfiler.Data.ProfiledDbProvider" type="MvcMiniProfiler.Data.ProfiledDbProviderFactory, MvcMiniProfiler" /> </DbProviderFactories> </system.data>
我想知道我是否为此设置了错误-如果我的配置文件连接包含另一个配置文件连接包含
更新-至少有一个人看到了1.7的类似问题,尽管他是先编写代码的。我会继续玩,看看我是否能想出该做什么…试试1.9。随着更新的进行,我刚刚在Application_Start中添加了新的Initialize方法,并删除了DbProviderFactories配置部分,现在我有了使用EF的SQL评测(两个数据库偶数,一个数据库先使用代码,一个数据库先使用数据库)
这有用吗?还有另一个关于EF数据库配置的建议-可能需要尝试-可能会发生在明天深夜或周五(明天一整天都在客户网站上)。你有没有想过如何先使用EF数据库进行设置?@RyanW-没有-我想我会下载源代码,并在某个时候进行适当的尝试(抱歉,耽搁了-离开了hols)好的-好消息-它似乎已经被修复了!谢谢RyanW。@RyanW猜想您没有在Oracle数据库中尝试过这个,对吗?在当前版本2.1.0中,首先使用数据库似乎工作得很好。@JamesSkemp似乎不是,请参阅@VahidND-有趣。我在那天把它和一个新项目联系在了一起。
protected void Application_Start()
{
....other code
MiniProfilerEF.Initialize();
}