Using ServiceStack Mini Profiler in a standalone console application

Can I use ServiceStack Mini Profiler in a standalone console application? If so, where should I put the profiler to enable / disable the code? In ASP.NET hosted by ServiceStack, it is commonly used in Application_BeginRequest and Application_EndRequest .

+7
source share
2 answers

You can do it as follows:

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { // enable here // your code // disable here } } } 

or in the constructor and destructor:

 namespace ConsoleApplication1 { class Program { Program() { // enable here } ~Program(){ // disable here } static void Main(string[] args) { // your code } } } 
0
source
 public abstract class MyHostBase : AppSelfHostBase { this.GlobalRequestFilters.Add(OnBeginOfRequest); this.GlobalResponseFilters.Add(OnEnfOfRequest); } 
0
source

All Articles