1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

C#でlineプリプロセッサディレクティブのhiddenを使うと、usingディレクティブの追加が提案されない

Last updated at Posted at 2021-11-12

C#で、#line hiddenを使うと、usingの追加(等々)の提案がされなくなる。

↓通常時
2021111212392500.png

#line hiddenを使ってるとき
2021111212383357.png

仕様だろうか?

usingの提案がされなくなった!と思った場合は、オプションを開く前に#line hidden使ってないか確認の必要あり。

対策

そもそも#line hiddenを使おうと思ったのは、デバッグ時にステップ実行をスキップしたいコードがあったから。

これは、DebuggerStepThroughAttributeを使えば解決。
スキップしたいクラスやらメソッドやらに[DebuggerStepThrough]を付ければ、ステップ実行はスキップされる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?