How to conditionally compile `InternalsVisibleTo(…)` assembly info?
How to conditionally compile `InternalsVisibleTo(…)` assembly info? Using .Net Core 2.1, my AssemblyInfo.cs looks like this: using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("RazorWare.Core.Media")] [assembly: InternalsVisibleTo("RazorWare.Core.Business")] #if DEBUG [assembly: InternalsVisibleTo("RazorWare.CoreDL.Testing")] [assembly: InternalsVisibleTo("RazorWare.CoreDL.Testing.CreateNativeWindow")] [assembly: InternalsVisibleTo("RazorWare.CoreDL.Testing.CreateEventPump")] #endif ...and a screenshot of relevant project properties: The assembly attributes surrounded by #if-#endif are not grayed out when the project is set to Release . How can I coerce the compiler (VS???) to recognize the #if-#endif directive? #if-#endif Release #if-#endif "Define DEBUG constant" (eg. DEBUG conditional symbol) is shown checked - is that.. desired? – user2864740 ...