c# - How can I get the name of my Windows Service at runtime? -


i have new windows service i'm making in c# 4.0.

i'm trying drop in event logging code wrote while ago in seperate class.

i want set event source name of windows service without having change code next time drop service.

i'm looking this:

string source = application.name 

but can't seem find i'm after anywhere.

any takers?

if code within service application, do

string source = this.servicename; 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -