Preprocessing directives in namespace definitions not handled correctly
#endif is always missing in generated stubs, when the interface has namespace definition with preprocessor directives. Example:
namespace myProject.sublibrary
{
using System;
using System.Collections.Generic;
using System.IO;
#if WinIoT
using System.Threading.Tasks;
#else
using myProject.ThreadingLib
#endif
In this case the generated stubs contain the #if statement, but no #else or #endif and therefore no build is possible.
Sounds like a bug. I don't think preprocessor definitions are not handled at all (see here for how usings are being carried over to stubs). We would need to explicitly handle preprocessor definitions.
Please take a look at developers documentation for how to get started and it shouldn't be too hard to add handling for preprocessor definitions. I am happy to answer any questions.
Ok, thanks for the hint where to start. I will take a look. However, it might take some time until I get around to it. Additionally, I have not yet worked with the Roslyn Code Analysers, so I'll have to look into that as well. I'll get back to you if I have any concrete questions.
Sounds good @mawett. It's a bit tricky because preprocessor definitions can be around anything, not just usings, and they are not being handled at the moment.