I have a scenario where an assembly (i.e. the entry method inside it) can be called both via a GUI application and an IIS hosted application. I want to perform some action depending upon which process is calling it (like if GUI is calling it, some other forms will open while in case of the IIS application, this step will be skipped).
So, is there any way I can detect which process (I know the exact name of the process, in both of the cases) is calling the assembly inside the entry method?
I want to perform something like below
if (processName == "wpw3.exe")
{
LogWindow log = new LogWindow();
log.Show();
}
if (processName == "GUIApplication.exe")
{
WriteToLogFile(LogData);
}