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
Depends on how it's included. If it's just an include item you can use
Condition="'$(Configuration)' == 'Debug'
you mean exclude source files from being compiled?
or not serve some files unless in debug?
Exactly, I can of course exclude them using Although it would be easier to just ignore the entire directory.
no you can definitely achieve that
there's the Compile item
you can exclude files from it
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.
add the conditional that andrew suggested above as an attribute for the Compile tag
@Anton I will take a look into that.
Thank you very much guys for the input.