Visual Studio 2008でC#アプリをリモートデバッグ

リモートデバッグはいろいろと記事が書いてあるけど、微妙に設定で苦労したりするので、自分用のメモを書いてみました。下の参考記事を見ても分からなかった部分をまとめます。

ターゲットPCの設定

ユーザーアカウント

ターゲットPC上にホスト側と全く同じユーザーアカウントを作ります。ユーザー名とパスワードを完全に一致させておく必要があります。

ログイン

単にユーザーを作っただけではダメで、そのユーザーでログインしておきます。そして、リモートツールであるmsvsmon.exeを起動します。自動的に権限はそのユーザーになっているので、権限の変更は必要ありません。

デバッグ

ファイルパス

実行ファイルをビルドしたら、そのファイルをホスト側PCと全く同じターゲットPCのパスにコピーします。

プロジェクトプロパティ

ソリューションエクスプローラーでプロジェクトを右クリックしてプロパティを選びます。デバッグタブで"Use remote machine"をチェックして、リモートPC名を指定します。

デバッグ開始

ここまできたら、後はF5でプロセスをスタートさせます。リモートPCでプロセスがスタートしてデバッグが出来るようになっているはずです。

プロセスへアタッチ

もしリモートPC上で既にプロセスを走らせていたら、デバッグメニューからAttach to Process...を選択します。 リモートホストを指定したらプロセス一覧が出るので、デバッグしたいプロセスにAttachします。

リモートデバッグの参考記事

http://msdn.microsoft.com/en-us/library/bt727f1t.aspx
http://blogs.techrepublic.com.com/programming-and-development/?p=675
http://www.wictorwilen.se/Post/How-to-get-Remote-Debugging-work-properly...

大変参考になりました。どうもありがとうございます。!(^^

大変参考になりました。どうもありがとうございます。!(^^)!ふ~

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <code> <cite> <ul> <ol> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.
  • Link to Amazon products with: [amazon product_id inline|full|thumbnail]. Example: [amazon 1590597559 thumbnail]
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.