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
Post a Comment