noto's blog
2012年04月19日17:42 カテゴリプログラミングC# C#でWindowsサービス作成その2 前回の覚書から大分日がたってしまいました それもこれも、本業が結構忙しくて(というか問題多発せ終息しなくて)、更新が手つかずになっていました。 ということで、せっかくの覚え書きの続きを書こうと思いました。 前回は、MicrosoftのチュートリアルやMSDNのわかりにくさを愚痴りました あくまで個人的な思いなので、本気にしないでくださいまし 前回は、Windowsサービスとインストーラがセットになっていることを書きましたが、これは、何もこうしなければならないというわけではありません。 しかし、最終的にWindowsサービスのアプリケーションを作るのであれば、やはり最初から最終形を目指した形でソリューションやプロジェクトを作っておいた方が何かと問題も少ないと思った次第です。 では、さっそく第
Windowsでデーモンっぽいものを作るとなると、やはりサービスを書いて、管理ツールから開始や停止の制御ができた方がWindowsっぽくてかっこいい。 VisualStudio にはそれを.NETの言語で書くためのテンプレートがあり、それを使えば難なくできると思ったら、いくつか引っかかった点があった。 そこで、その引っかかりやすい点をメモするついでに作り方を書いておこうと思う。 プロジェクトの作成、インストーラの設定 まず、VisualStudioの新規プロジェクト作成から「Windowsサービス」を選ぶ。 OKを押すと、Service1のデザイナが表示される。 ここで、早速サービスのコードを書き始めても良いのだけど、書いたところで「インストーラクラス」をプロジェクトに追加しないとビルドしても登録できない、つまりデバッグもできないんで、先にインストーラクラスを作っておく。 やり方は簡単。S
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く