Unable to add breakpoints in regions wrapped by #if / #endif

For a shared file switched to a “nougat” project:

#if NOUGAT

// You can’t add breakpoints here.
// Visual Studio 2015 RC always says: This is not a valid location for a breakpoint.

#endif

I can work around this annoying bug by:

  1. remove #if / #endif
  2. add breakpoints
  3. restore #if / #endif

This should only happen if Nougat isn’t defined (if in a shared file, switch to the “nougat” project) or when the file isn’t part of this project, when do you get this?

I’ve forgotten to mention that this happens in files of SharedProject and I’m sure the the file is already switched to the “nougat” project.

hrmm oke that shouldn’t be possible. Do you have steps for me I can try?

Try these steps in Visual Studio 2012 or 2015 RC:

  1. Add some codes in your shared file which is already switched to a “nougat” project.
  2. Check that you can add breakpoints to the codes, then cancel all breakpoints.
  3. Use #if NOUGAT … #endif to wrap the codes.
    ( After this, you can see the codes are still highlighted instead of being faded)
  4. Check if you can still add breakpoints to the codes. Here I failed.

I’m not sure if other people can reproduce the problem, please let me know.