人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

May 16, 2006

.net 开发service必须要写一个从Installer类继承的类

Filed under: 经验积累

出自

http://www.cnblogs.com/jjstar/archive/2004/07/02/20354.aspx

我一直有一个误区:只要从System.ServiceProcess.ServiceBase继承一个类并编译好就可以用.net提供的命令行程序InstallUtil.exe安装了。但实际上如果仅仅做了这样的一个类是无法用InstallUtil.exe安装的,在安装时会报错:

这是因为installUtil.exe会用反射的方法去查找所有把RunInstallerAttribute设置为true的System.Configuration.Install.Installer类型,并执行上面的Install方法,当找不到的时候,安装就失败了。
所以我们必须要写一个从Installer类继承的类来满足installUtil.exe的要求。

Comments »

The URI to TrackBack this entry is: http://recordsome.blogsome.com/2006/05/16/p35/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham