Search code examples
visual-studioweb-configreleaserelease-management

Exclude files only in "release" in VS2008 config


I was wondering how to "Exclude" individual files in the "release" web.csproj config of my solution. I've seen other answers and they all feature "include" - but this is not what I am wanting to achieve. I only want to exclude around 10-15 files from a "release" package ?

I don't want to manually edit the web.csproj file - so is there any way I can do this via web.config or ?

How would I go about doing this ?


Solution

  • Excluding files is global unfortunately (I don't know of a way to achieve it directly).

    A workaround for this would be to enclose the contents of the files in

    #if DEBUG
       ...
    #endif
    

    to conditionally exclude the contained code from the build.