Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Configuration-Specific Settings in Visual Studio 2010

Configuration-Specific Settings in Visual Studio 2010

Scheduled Pinned Locked Moved Visual Studio
helpcsharpvisual-studiodata-structuresdebugging
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patrick Skelton
    wrote on last edited by
    #1

    Hi, Does anyone know if it is possible to have, for example, a reference to an assembly in a debug build that is not present in the release build in Visual Studio 2010? In other words, to have assembly references set which are specific to a build configuration? On a closely-related issue, does anyone know if it is possible to have a file included in the project tree only for a specific configuration? If this isn't possible, is it at least possible to specify a different build rule for one configuration (e.g. have copy-to-output-directory only for the debug build and not the release)? I am struggling to find information on this, so any help or pointers-to-info would be very much appreciated. Best wishes, Patrick

    A L 2 Replies Last reply
    0
    • P Patrick Skelton

      Hi, Does anyone know if it is possible to have, for example, a reference to an assembly in a debug build that is not present in the release build in Visual Studio 2010? In other words, to have assembly references set which are specific to a build configuration? On a closely-related issue, does anyone know if it is possible to have a file included in the project tree only for a specific configuration? If this isn't possible, is it at least possible to specify a different build rule for one configuration (e.g. have copy-to-output-directory only for the debug build and not the release)? I am struggling to find information on this, so any help or pointers-to-info would be very much appreciated. Best wishes, Patrick

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      These things are quite possible. You will, however, need different MSBuild scripts to do this. Have two build scripts, build and release and call them based on a parameter. That should do it. It may actually just be possible to do this through the IDE itself - see http://visualstudiohacks.com/general/customize-your-project-build-process/[^].

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

      P 1 Reply Last reply
      0
      • A Abhinav S

        These things are quite possible. You will, however, need different MSBuild scripts to do this. Have two build scripts, build and release and call them based on a parameter. That should do it. It may actually just be possible to do this through the IDE itself - see http://visualstudiohacks.com/general/customize-your-project-build-process/[^].

        The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

        P Offline
        P Offline
        Patrick Skelton
        wrote on last edited by
        #3

        Added a batch file called Post Build to delete the unnecessary files. Works but feels like a real hack to me. Seems like a big limitation to me that you can't specify different build behaviour for a file depending on the configuration. Thanks for the help. Best wishes - Patrick

        1 Reply Last reply
        0
        • P Patrick Skelton

          Hi, Does anyone know if it is possible to have, for example, a reference to an assembly in a debug build that is not present in the release build in Visual Studio 2010? In other words, to have assembly references set which are specific to a build configuration? On a closely-related issue, does anyone know if it is possible to have a file included in the project tree only for a specific configuration? If this isn't possible, is it at least possible to specify a different build rule for one configuration (e.g. have copy-to-output-directory only for the debug build and not the release)? I am struggling to find information on this, so any help or pointers-to-info would be very much appreciated. Best wishes, Patrick

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Patrick Skelton wrote:

          On a closely-related issue, does anyone know if it is possible to have a file included in the project tree only for a specific configuration?

          As far as I am aware this is possible. Just use the project properties and change the settings for either the Release or Debug build as appropriate. I have definitely done something similar in the past with the Express Edition of VC++. The same should hold true for the copy you mentioned. The only problem I see here is that it is easy to get things messed up when you want to change any settings. An easier way is to create a second project within the solution that references only those source files necessary, and has all its settings totally independent of the original project.

          Just say 'NO' to evaluated arguments for diadic functions! Ash

          P 1 Reply Last reply
          0
          • L Lost User

            Patrick Skelton wrote:

            On a closely-related issue, does anyone know if it is possible to have a file included in the project tree only for a specific configuration?

            As far as I am aware this is possible. Just use the project properties and change the settings for either the Release or Debug build as appropriate. I have definitely done something similar in the past with the Express Edition of VC++. The same should hold true for the copy you mentioned. The only problem I see here is that it is easy to get things messed up when you want to change any settings. An easier way is to create a second project within the solution that references only those source files necessary, and has all its settings totally independent of the original project.

            Just say 'NO' to evaluated arguments for diadic functions! Ash

            P Offline
            P Offline
            Patrick Skelton
            wrote on last edited by
            #5

            Hi, Thanks for the answer. Not sure I can see how to do the first part of what you suggest. I can't see any way to exclude a file from just one project configuration. Your second idea is a good one though. I can't believe I didn't think of that myself. Doh! It's so obvious. Best wishes - Patrick

            L 1 Reply Last reply
            0
            • P Patrick Skelton

              Hi, Thanks for the answer. Not sure I can see how to do the first part of what you suggest. I can't see any way to exclude a file from just one project configuration. Your second idea is a good one though. I can't believe I didn't think of that myself. Doh! It's so obvious. Best wishes - Patrick

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Patrick Skelton wrote:

              Not sure I can see how to do the first part of what you suggest. I can't see any way to exclude a file from just one project configuration.

              Select the file then right-click to get the Properties dialog. Go to Configuration -> General and you can then exclude it from the build for the selected configuration only.

              Just say 'NO' to evaluated arguments for diadic functions! Ash

              P 1 Reply Last reply
              0
              • L Lost User

                Patrick Skelton wrote:

                Not sure I can see how to do the first part of what you suggest. I can't see any way to exclude a file from just one project configuration.

                Select the file then right-click to get the Properties dialog. Go to Configuration -> General and you can then exclude it from the build for the selected configuration only.

                Just say 'NO' to evaluated arguments for diadic functions! Ash

                P Offline
                P Offline
                Patrick Skelton
                wrote on last edited by
                #7

                Yes, got it - thanks. I have an assembly DLL getting copied that I don't want too, so I think the separate project idea is the way to go. - Patrick

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups