C
C#5d ago
WAASUL

Include directory only in DEBUG.

Is there a way to only include a directory in debug. It's an asp net core web app?
7 Replies
lycian
lycian5d ago
Depends on how it's included. If it's just an include item you can use Condition="'$(Configuration)' == 'Debug'
Anton
Anton5d ago
you mean exclude source files from being compiled? or not serve some files unless in debug?
WAASUL
WAASULOP5d ago
Exactly, I can of course exclude them using
#if DEBUG
#endif
#if DEBUG
#endif
Although it would be easier to just ignore the entire directory.
Anton
Anton5d ago
no you can definitely achieve that there's the Compile item you can exclude files from it
Anton
Anton5d ago
Exclude Files from the Build - MSBuild
Discover how to explicitly exclude or conditionally include files from builds for MSBuild project files with attributes and wildcards.
Anton
Anton5d ago
add the conditional that andrew suggested above as an attribute for the Compile tag
WAASUL
WAASULOP5d ago
@Anton I will take a look into that. Thank you very much guys for the input.
Want results from more Discord servers?
Add your server