My application is not firing the event AfterSessionComplete
. Code Below
fiddler.cs
namespace proj
{
public static class Fiddler
{
public static void start()
{
startProxy();
}
public static void startProxy()
{
FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
FiddlerApplication.Startup(8888, true, true, true);
}
public static void FiddlerApplication_AfterSessionComplete(Session sess)
{
//Working aftersessioncomplete
}
}
}
Service1.cs
namespace Proj
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
Fiddler.start();
}
protected override void OnStop()
{
}
internal void TestStartupAndStop(string[] args)
{
this.OnStart(args); //use to debug
//For commandLine
}
}
}
program.cs
namespace Proj
{
static class Program
{
static void Main(string[] args)
{
if (Environment.UserInteractive)
{
Service1 service1 = new Service1();
service1.TestStartupAndStop(args);
}
else
{
}
}
}
}
I'm creating a windows service but I was facing a debugging issue, that's why I use the console application debug to check my code working or not.
I added break point at aftersessioncomplete
event when I get to know that FiddlerApplication.AfterSessionComplete
is not firing. It stops the application without going on public static void FiddlerApplication_AfterSessionComplete(Session sess)
Anyone can help? or faced same issue?
After Session cannot fire in window service because of the Certificate popup the certificate as for GUI which windows service cannot provide so the code stuck at certificate installation and not firing after session events. To work out with this one keep in mind to use console app and hide console app after installation of certificate