AArnott / CodeGeneration.Roslyn

Assists in performing Roslyn-based code generation during a build.
Microsoft Public License
408 stars 59 forks source link

Problem with #if #endif in using #32

Closed bhugot closed 6 years ago

bhugot commented 7 years ago

Hello,

If you have an #endif in end of using section Then you don't set it in the generated code

if NETSTANDARD1_3

using SomeLib;

else

using AnotherLib;

endif

in generated code you get

if NETSTANDARD1_3

using SomeLib;

else

using AnotherLib;

so you are stuck

Known workarounds

set an using after #endif

AArnott commented 6 years ago

Reactivating because now I have a problem where I need the trivia included to avoid build breaks (or the using directives in the inactive path should be removed).