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 Basic
  4. test compile mode versus production compile mode

test compile mode versus production compile mode

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
5 Posts 2 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.
  • D Offline
    D Offline
    dcof
    wrote on last edited by
    #1

    In a vb.net 2010 application, I have a page_load section of code where I would like to know add extra code unless I need it. Basically if the application is in development or test compile mode, I would like the application to point to a test url. If the application is in production mode, I would like the application to point to a production url. From the page_load section of code, is there a way to knowwhat mode the applicaiton is in? If so, can yhou show me the code on how to accomplish this goal? In addition, if the application is in production mode is there a way to not have the development or test logic be accessed by the application? If so, would you show me that logic?

    L 1 Reply Last reply
    0
    • D dcof

      In a vb.net 2010 application, I have a page_load section of code where I would like to know add extra code unless I need it. Basically if the application is in development or test compile mode, I would like the application to point to a test url. If the application is in production mode, I would like the application to point to a production url. From the page_load section of code, is there a way to knowwhat mode the applicaiton is in? If so, can yhou show me the code on how to accomplish this goal? In addition, if the application is in production mode is there a way to not have the development or test logic be accessed by the application? If so, would you show me that logic?

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

      See .net - How to use #IF DEBUG in VB.NET - Stack Overflow[^] and #If...Then...#Else Directives (Visual Basic) | Microsoft Docs[^].

      D 1 Reply Last reply
      0
      • L Lost User

        See .net - How to use #IF DEBUG in VB.NET - Stack Overflow[^] and #If...Then...#Else Directives (Visual Basic) | Microsoft Docs[^].

        D Offline
        D Offline
        dcof
        wrote on last edited by
        #3

        What you supplied to me is a very good option that works! However on my application, there are the build options for: 1-Development, 2-Test, and 3-Production. Based upon my build options, can I write code the will select only '1-Development' instead of placing #debug in the logic. Or having #debug stand for 1-development? If so, would you should me the code for this?

        L 1 Reply Last reply
        0
        • D dcof

          What you supplied to me is a very good option that works! However on my application, there are the build options for: 1-Development, 2-Test, and 3-Production. Based upon my build options, can I write code the will select only '1-Development' instead of placing #debug in the logic. Or having #debug stand for 1-development? If so, would you should me the code for this?

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

          Sorry but I do not understand what you mean. The DEBUG define is automatically set by Visual Studio when you do a Debug build, and unset when you do a Release build. You need to decide what you want for a Test build and create the appropriate settings.

          D 1 Reply Last reply
          0
          • L Lost User

            Sorry but I do not understand what you mean. The DEBUG define is automatically set by Visual Studio when you do a Debug build, and unset when you do a Release build. You need to decide what you want for a Test build and create the appropriate settings.

            D Offline
            D Offline
            dcof
            wrote on last edited by
            #5

            This answers my question

            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