问题标签 [mvc-mini-profiler]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net-mvc-3 - 首先分析 EF 数据库仍然存在问题
使用 EF 4.1 和 Mini-profiler 1.7。使用模型优先,从现有数据库中扫描。EF 生成一个派生自 ObjectContext/ObjectSet 的类,而不是 DbContext/DbSet。我找不到任何地方来控制它。
我尝试了流行的解决方案,但无济于事。
受挫后,我还尝试使用直接使用 ProfiledDbConnection 创建的显式 EntityConnection 直接创建我的 Context。我想绕过连接不是预期类型的任何机会。
我已经验证了正确的路径。然而,当实际运行一个 LINQ 查询时,我们得到一个异常:
无法将“MvcMiniProfiler.Data.ProfiledDbConnection”类型的对象转换为“System.Data.SqlClient.SqlConnection”类型。
冒犯的说法是:
堆栈跟踪更有趣,因为显然 EF 内部的某些东西绝对需要 SqlConnection!
在 System.Data.SqlClient.SqlCommand.set_DbConnection(DbConnection 值) 在 System.Data.Common.DbCommand.set_Connection(DbConnection 值) 在 System.Data.Common.Utils.CommandHelper.SetStoreProviderCommandState(EntityCommand entityCommand, EntityTransaction entityTransaction, DbCommand storeProviderCommand)在 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior 行为) 在 System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues) 在 System.Data.Objects.ObjectQuery
1.GetResults(Nullable
1 forMergeOption)在 System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable.GetEnumerator() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 源)
显然,如果我改为给它一个 SqlConnection,一切都会很愉快。
这里发生了什么?这是怎么回事?也许它从未适用于 EDMX 案例?它是 ObjectContext 派生的这一事实有什么影响吗?
asp.net-mvc - mvc miniprofiler 使用 DbConnection 和实体框架 EntityConnection
我觉得我在这里遗漏了一些非常简单的东西,我正在将 MVC Miniprofiler 集成到我的项目中,但是我找不到用正确的连接实例化我的上下文的方法,因为它不是 EF Code First 并且我的模型继承自 ObjectContext,在这里是我的代码
如何解决这个问题?
c# - 使用迷你轮廓仪
使用迷你分析器时,这是否意味着生产代码将被使用块“乱扔”?
我想如果它是 1-off 测试,我可以将其删除,但通常您希望将它们保留在代码库中以进行持续分析。
c# - 带有 Microsoft Enterprise Library 的 MVC Mini Profiler
我确信可以分析企业库 SQL 命令,但我无法弄清楚如何包装连接。这就是我想出的:
这会导致以下异常:
无法将“MvcMiniProfiler.Data.ProfiledDbCommand”类型的对象转换为“System.Data.SqlClient.SqlCommand”类型。
mvc-mini-profiler - 如何在不更改源的情况下将 MVCMiniProfiler 与 PetaPoco 集成
我正在尝试让MVCMiniProfiler与PetaPoco一起工作
我正在尝试在创建 PetaPoco DB 时设置连接,但遇到问题(connectionClosed)
我已经阅读了这个项目https://github.com/toptensoftware/PetaPoco/issues/44但可以让它工作
正确的方法是什么?
编辑
该解决方案由 Gareth Elms 提供:
c# - 无法让 MvcMiniProfiler 与 EF4.1 和我们的存储库模式一起使用
我们在尝试让 MvcMiniProfiler 与我们的存储库模式的 EF 实现一起工作时遇到了很多问题。
错误:
实体类型 CustomEntityPewPewFooFoo 不是当前上下文模型的一部分。
好的。这是我们已经完成的代码。
自定义 UnitOfWork 上下文类
添加出厂设置的东西...
最后,添加这些额外的东西......
我的连接字符串...
最后(再次),然后是 edmx info ..
mvc-mini-profiler - Mvc-Mini-Profiler:为什么有这么多 X-MiniProfiler-Id?
我正在使用 Mvc-Mini-Profiler(多么棒的产品!)。使用我的普通网络浏览器,一切似乎都可以正常工作,但是一旦我使用我自己的 http 客户端(基本的 http 1.1 不支持 cookie),http 标头中X-MiniProfiler-Id的数量就会增加。这种情况发生得非常快,并且在很短的时间内变得非常多(11kB 及以上的数据)。
缺少 cookie 能否使 Mvc-Mini-Profiler 以这种方式工作,或者我的实现可能有什么问题?
c# - MiniProfiler 在 ASP.NET MVC2 中是否工作?
StackExchange MiniProfiler http://code.google.com/p/mvc-mini-profiler/在 ASP.NET MVC2 中工作吗?如果是这样,怎么做?将 MiniProfiler 添加到项目时,MVC2 等效于:
c# - Stack Exchange MiniProfiler 不显示配置文件框?
我已经安装了 Stack Exchange MiniProfiler,查看源代码显示它正在呈现预期的 HTML。但是它没有显示角落里的小配置文件详细信息框 - 可能有什么问题?
在我的 Global.asax.cs 中:
编辑:感谢 Sam 的输入,我已将问题跟踪到我的 .ajaxSetup() 方法。当它被注释掉时,配置文件框再次显示。但我不明白为什么这是一个问题:
c# - 如何将 MvcMiniProfiler 与 MvcTurbine 一起使用?
我正在使用 MvcTurbine 自动连接IViewEngines
你的项目,我最近添加了 MvcMiniProfiler 并试图让它工作唯一的问题是 MvcMiniProfiler 有一个 ProfilingViewEngine 需要 IViewEngine 的构造函数参数,因此它在 Structuremap 中创建双向依赖. 下面是错误
您如何忽略或手动向 MvcTurbine 注册 IViewEngines?