Visual Studio ignores the code inside #if DEBUG / RELEASE scope and doesn't check for errors or autocompletes

前端 未结 3 2006
无人及你
无人及你 2021-01-12 23:54

I\'ve been writing an #if DEBUG, #else, #endif fragment of code, and I noticed that Visual Studio doesn\'t let me use autocomplete to

3条回答
  •  自闭症患者
    2021-01-13 00:39

    I know this is a late answer, but it still applies to this day.

    TL;DR: this is a VS bug, which affects only affects netstandard/netcore projects (or simply put, the new .csproj format).

    The workaround is... nasty! Reload the project file (or close and reopen VS).

    The good news: this does not affect compilation :)

    You can read more here and here.

提交回复
热议问题