开发者

Write to InstallLog from Installer

How do I write to the InstallLog from a service installer?

I've overridden the OnBeforeInstall method of my class (which derives from System.Configuration.Install.Installerand now I want to write to the installer log. But I can't see anything that would allow me to do this.

Console.WriteLine will wr开发者_运维百科ite to the console but not to the log.


As far as I can see, there's a property called Context in the Installer class. It has type InstallContext. That type has the method LogMessage(), which I suppose is what you need. See this article for more information about LogMessage() method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜