問題タブ [target-framework]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
54 参照

.net - TargetFramework に加えて、RuntimeIdentifier に基づいて Visual Studio のコンテキストを切り替える

ソース コードでプリプロセッサ条件を使用して、RuntimeIdentifier に基づいて異なるコードを発行しています。ただし、TargetFramework と RuntimeIdentifier の両方に基づくコンテキストを選択できないため、コードは常にグレー表示されます。

Visual Studio のナビゲーション バーで、net461 と netstandard2.0 を切り替えることができます。TargetFramework と RuntimeIdentifier の両方を切り替えてコードをアクティブにするにはどうすればよいですか?

アクティブにしたいコードスニペットは次のとおりです(グレー表示されていません): ここに画像の説明を入力

Visual Studio 2017 バージョン 15.9.23 を使用しています。

これが私のcsprojのスニペットです: