473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Get build configuration string (Debug or Release) at run time

How can I get the build configuration string (Debug or Release) at run
time?

I currently use the following code to get the version number from the
AssemblyInfo.vb AssemblyVersion attribute, and wonder if there is
something similar for getting the build configuration.

Private Function getAppVersion() As String

Dim aName As System.Reflection.AssemblyName

aName = Reflection.Assembly.GetExecutingAssembly().GetName ()
getAppVersion = " - Version " + aName.Version.Major.ToString + "." +
aName.Version.Minor.ToString

End Function
Nov 20 '05 #1
2 6353
John,
How can I get the build configuration string (Debug or Release) at run
time?


How about:

Dim config As String = "Release"
#If DEBUG Then
config = "Debug"
#EndIf

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #2
* Mattias Sjögren <ma********************@mvps.org> scripsit:
How can I get the build configuration string (Debug or Release) at run
time?


How about:

Dim config As String = "Release"
#If DEBUG Then
config = "Debug"
#EndIf


.... in the prioject properties, "Configuration settings" -> "Build" the
checkbox "Define DEBUG constant" must be checked.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: cody | last post by:
We have a huge project, the solutuion spans 50 projects growing. Everytime I want to start the project I have to wait nearly over 1 minute for the compiler to complete building. This is...
5
by: David++ | last post by:
Hi there, I have built a DLL in Visual C++ 6. When I build the DLL it builds fine for the debug version of the DLL (and this DLL works fine), however, I seem unable to build a Release version of...
3
by: Steve Franks | last post by:
I'm using Visual Studio 2005 RC and cannot figure out how to produce a "release" build. Am I doing something wrong? I'm wondering if perhaps MS locked out the ability to produce a release build...
7
by: Tom | last post by:
How can I make code not execute for a debug build, but do execute for a production build? I have code which prompts for an account and password when the program starts up. It is a pain to have to...
10
by: musosdev | last post by:
I've got a function that needs to work slightly differently on the development server from the production server, but of course I don't want to be changing code just before compiling a release...
4
by: andy6 via DotNetMonster.com | last post by:
I am in VS2005 Configuration Manager and have selected from the Active Solution Configuration "release". The deployment project and a supporting c# dll project both switch to release, however the...
8
by: Bruce | last post by:
I am using VB in Vs2005. Am I missing something or does VB not have the concept of "builds" (release/debug) like in VC? I wrote an assembly and I would like to have a debug version of the DLL...
0
by: =?Utf-8?B?QmV0aA==?= | last post by:
Hi. I'm trying to provide information about compile-time options at runtime, including the build configuration. I saw in one post that if you set the DEBUG constant, you could rely on it to...
4
by: Ronny | last post by:
I have a mixed solution -most of its projects are in C# and some are in C++?MFC. Problem is that when I compile the solution with batch build the MFC files end up wit compilation errors, but if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.