.net - Windows Service without Visual Studio interference -
i'd create , manage windows service application without "help" visual studio's designer.
since .net, , judging msdn , designer does, means inheriting installer
, , constructing , dealing serviceprocessinstaller
, serviceinstaller
able manage install-time execution of serivce.
runtime, means creating servicebase
subclass , starting main
using servicebase.run
(and overriding various servicebase
event handling methods).
however, when this, visual studio insists on treating installer
, servicebase
subclasses designer-edited files. doesn't readability, not mention fact can't deal handwritten code @ all. i'd avoid designer keep things manageable (to avoid nebulous who-knows-what-runs-when, particularly code that's tricky test , debug such windows services after must installed run @ all), , able specify service name @ run-time, rather @ compile time - designer doesn't support that.
how can create windows service application without gunk?
servicebase
derived component
. disable designer view can attach attribute so:
[system.componentmodel.designercategory("code")] public class myservice : servicebase { }
Comments
Post a Comment