Xây dựng Windows Service với C# – Phần 5

Tạo một trình ứng dụng loại Setup để cài đặt (Install)Service:

Bước 13:

Từ menu à File --> Add Project --> New Project.

xay dung windows service trong C#

    Đặt tên ProjectsSetupGiamSatThuMuc

xay dung windows service trong C#

Bước 14:

Trong cửa sổ Solution Explorer, click phải chuột tại SetupGiamSatThuMuc --> Add Project Output

xay dung windows service trong C#

    Từ cửa sổ Add Project Output Group --> chọn Primary Output --> click OK

xay dung windows service trong C#

Bước 15:

Trong cửa sổ Solution Explorer, click phải chuột tại mục SetupGiamSatThuMuc -->View --> Custom Actions.

Bước 16 :

Tại mục Custom Actions --> click phải chuột --> Add Custom Action

Bước 17 :

Xuất hiện cửa sổ Select Item in Project --> Double-click mục Application Folder, chọn mục Primary Output from swGiamSatThuMuc (Active) --> click OK.

xay dung windows service trong C#

xay dung windows service trong C#

Bước 18 :

Thực hiện việc build trình ứng dụng SetupGiamSatThuMuc (chú ý nhớ chọn định cấu hình cho SolutionRelease ).   

xay dung windows service trong C#

Không có nhận xét nào: