1

I have a C# project which targets net48 and netcore20. I see that the code files where there is a conditional compilation with regards to the net framework, the code is greyed out - no IntelliSense or color formatting to help with the code development. Is there a setting to enable this?

Visual Studio 2022 Enterprise Edition

  • 4
    Change the active build configuration to match that specified in the [Conditional(“xxxxx”)] –  Dec 10 '21 at 10:45
  • Hi @MickyD: I could see only Release/Debug configurations in the Build->Configuration Manager. – Arun Prakash Nagendran Dec 10 '21 at 10:52
  • You need to know what preprocessor symbols are checked for those conditional code blocks. Then have suitable build configurations that set those symbols. – Richard Dec 10 '21 at 10:58
  • Is Resharper installed? Then use the left dropdown box above the code window to change the configuration. – PMF Dec 10 '21 at 12:35

0 Answers0