mvc-mini-profiler

How to get MVC-mini-profiler working on EF 4.1 Database First

大城市里の小女人 提交于 2019-12-24 00:14:12
问题 Spent better part of the day combing through SO for this. Here's the setup MVC 3 App using Repository pattern with 3 repositories across 2 databases. EF 4.1 Database first using the DBContext API for both db connections. Installed mvc-mini-profiler from nuget This is how I create my Db Context in the repository public class TransactionRepository : BaseRepository, ITransactionRepository { AccountingEntities _db = new AccountingEntities(); // repository methods } Then in controllers public

Using MiniProfiler for direct ADO.net calls

谁都会走 提交于 2019-12-23 19:05:09
问题 This question will be silly for those who are geeks in C# and profilers. I am new to c# (basically a c++ developer) . I can profile the database queries if it use dbproviderfactory , but i cannot profile the ado.net calls when it is used directly(raw SqlConnection & SqlCommand ). I came across the Miniprofiler code where they also profile direct ADO.net calls. I just dont know how to use it ( integrate it in my profiler ). My code is SqlConnection myConn = new SqlConnection(@"Server=192.168

error on MiniProfilerEF6.Initialize() c#?

▼魔方 西西 提交于 2019-12-23 10:08:38
问题 I'm using miniprofiler in MVC project on App_Start() method I invoke MiniProfilerEF6.Initialize() and I get the error : the Entity Framework was already using a DbConfiguration instance before an attempt was made to add an 'Loaded' event handler. 'Loaded' event handlers can only be added as part of application start up before the Entity Framework is used. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information. 回答1: try to add MiniProfilerEF6.Initialize() in application_start

Donut hole caching - exclude MiniProfiler.RenderIncludes

百般思念 提交于 2019-12-23 09:39:09
问题 I have an ASP.NET MVC action that is decorated with the OutputCache attribute, but the problem is that the MiniProfiler output is cached as well. I'd like to exclude the MiniProfiler output from the caching (donut hole), but I'm not sure how I can exclude a call like MiniProfiler.RenderIncludes(). Anyone who happen to know how I can do this? 回答1: This is an important point if using MiniProfiler in production. As if the first visit to a page is by a user where MiniProfiler is enabled, all

How can integrate MVCMiniProfiler with PetaPoco without changing the sources

自作多情 提交于 2019-12-21 18:13:06
问题 I'm trying to get MVCMiniProfiler to work with PetaPoco I'm trying to set the connection in the creation of the PetaPoco DB, but run into problems (connectionClosed) public class DbHelper { static Database _CurrentDb = null; public static Database CurrentDb() { if (_CurrentDb == null) { string connstr = ConfigurationManager.ConnectionStrings["MainConnectionString"].ConnectionString; var conn = ProfiledDbConnection.Get(new SqlConnection(connstr)); _CurrentDb = new PetaPoco.Database(conn); }

MVC Mini Profiler includes not respecting application's path

给你一囗甜甜゛ 提交于 2019-12-21 07:49:09
问题 I've got the MVC Mini Profiler set up as described on its project page, and the includes are indeed being written on the page. Problem is, my application sits at http://localhost:8080/web , and the markup written by the profiler includes looks like this: <link rel="stylesheet/less" type="text/css" href="/mini-profiler-includes.less?v=2.0.4177.17902"> <script type="text/javascript" src="/mini-profiler-includes.js?v=2.0.4177.17902"></script> <script type="text/javascript"> jQuery(function() {

How to properly authenticate mvc-mini-profiler with AspNetSqlMembershipProvider

萝らか妹 提交于 2019-12-20 10:33:58
问题 I tried to check if the user is in role at Application_BeginRequest and Application_AuthenticateRequest with this code and it will not work. At BeginRequest the code is never hit and Authenticate it's hit with some of the request and the profiler does not show up. Checking only for Request.IsLocal works fine. if(Request.IsAuthenticated) { if(User.IsInRole("Admin"); MiniProfiler.Start(); } Any idea or why it's not working or better way to do it? [Update] I accepted the awnser but undid it as I

Servicestack.net Mini Profiler in razor view

僤鯓⒐⒋嵵緔 提交于 2019-12-19 08:53:06
问题 Is it possible to use the mini profiler in service stack with the razor views? It looks like the documentation only shows the profiler when using the json html report view. 回答1: Yes you can include it using the same MVC include but include it .AsRaw() so it doesn't get HTML encoded, e.g: @ServiceStack.MiniProfiler.Profiler.RenderIncludes().AsRaw() Example taken from this RazorRockstars template. 来源: https://stackoverflow.com/questions/12586343/servicestack-net-mini-profiler-in-razor-view

Servicestack.net Mini Profiler in razor view

喜你入骨 提交于 2019-12-19 08:50:04
问题 Is it possible to use the mini profiler in service stack with the razor views? It looks like the documentation only shows the profiler when using the json html report view. 回答1: Yes you can include it using the same MVC include but include it .AsRaw() so it doesn't get HTML encoded, e.g: @ServiceStack.MiniProfiler.Profiler.RenderIncludes().AsRaw() Example taken from this RazorRockstars template. 来源: https://stackoverflow.com/questions/12586343/servicestack-net-mini-profiler-in-razor-view

How to hook up SqlDataAdapter to profile db operations with mvc mini profiler

人盡茶涼 提交于 2019-12-18 08:53:57
问题 I looked up How could I instantiate a Profiled DataAdapter to use with MVC MINI PROFILER? but this also did not answer my question. I have some code like this in SqlDatasource class - protected SqlCommand sqlCommand; public SqlDatasource(String query, String connectionString) : this(connectionString) { this.sqlCommand.CommandText = query; } public DataTable getResults() { DataTable table = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(this.sqlCommand); SqlCommandBuilder