Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to remove particular character from the string Pin
M Riaz Bashir11-Apr-10 21:10
M Riaz Bashir11-Apr-10 21:10 
AnswerRe: How to remove particular character from the string Pin
Sandesh M Patil12-Apr-10 0:48
Sandesh M Patil12-Apr-10 0:48 
QuestionSetting [assembly: InternalsVisibleTo("UI Test")] Conditionally if it is DEBUG Mode Pin
Nadia Monalisa11-Apr-10 20:24
Nadia Monalisa11-Apr-10 20:24 
AnswerRe: Setting [assembly: InternalsVisibleTo("UI Test")] Conditionally if it is DEBUG Mode Pin
Abhinav S11-Apr-10 20:41
Abhinav S11-Apr-10 20:41 
AnswerRe: Setting [assembly: InternalsVisibleTo("UI Test")] Conditionally if it is DEBUG Mode Pin
Ravi Bhavnani12-Apr-10 1:58
professionalRavi Bhavnani12-Apr-10 1:58 
GeneralRe: Setting [assembly: InternalsVisibleTo("UI Test")] Conditionally if it is DEBUG Mode Pin
Nadia Monalisa12-Apr-10 21:17
Nadia Monalisa12-Apr-10 21:17 
GeneralRe: Setting [assembly: InternalsVisibleTo("UI Test")] Conditionally if it is DEBUG Mode Pin
Ravi Bhavnani13-Apr-10 4:44
professionalRavi Bhavnani13-Apr-10 4:44 
QuestionExecute a segment of code conditionally IF it is DEBUG mode or RELEASE mode Pin
Nadia Monalisa11-Apr-10 20:16
Nadia Monalisa11-Apr-10 20:16 
Hello everyone,

I am just thinking if it is possible to execute a block of code conditionally based on DEBUG Mode / RELEASE Mode ?

For example, I have a code block like this:

var x = 5;
var y = 0;
var z = x / 5;


Now, I want that my application should throw exception only if it is DEBUG mode so that I can be notified any possible exception when I am developing my Windows Application. But when I will ship my application to my customer, I dont want
that the customer get the Exception, so, for my production version or RELEASE mode, I want the block to be like this,

try
{
  var x = 5;
  var y = 0;
  var z = x / 5;
}
catch
{
}


Now, Is it possible to do so ? I know there are some #pragma directive to execute code conditionally, but I dont know
if it is possible to detect DEBUG / RELEASE mode from my #pragma directive code, any idea please ?
AnswerRe: Execute a segment of code conditionally IF it is DEBUG mode or RELEASE mode Pin
Abhinav S11-Apr-10 20:43
Abhinav S11-Apr-10 20:43 
QuestionWhat is equivalent to java property file in .net Pin
Joe Rozario11-Apr-10 19:42
Joe Rozario11-Apr-10 19:42 
AnswerRe: What is equivalent to java property file in .net Pin
David Skelly11-Apr-10 22:17
David Skelly11-Apr-10 22:17 
Questionrow headers Pin
Member 59031011-Apr-10 19:33
Member 59031011-Apr-10 19:33 
AnswerRe: row headers Pin
dan!sh 11-Apr-10 20:46
professional dan!sh 11-Apr-10 20:46 
GeneralRe: row headers Pin
Member 59031011-Apr-10 20:55
Member 59031011-Apr-10 20:55 
GeneralRe: row headers Pin
dan!sh 11-Apr-10 21:32
professional dan!sh 11-Apr-10 21:32 
GeneralRe: row headers Pin
Member 59031011-Apr-10 21:34
Member 59031011-Apr-10 21:34 
GeneralRe: row headers Pin
dan!sh 11-Apr-10 21:48
professional dan!sh 11-Apr-10 21:48 
AnswerRe: row headers Pin
arun_pk11-Apr-10 22:51
arun_pk11-Apr-10 22:51 
Questionobject classs in c# 2.0 Pin
prasadbuddhika11-Apr-10 18:41
prasadbuddhika11-Apr-10 18:41 
AnswerRe: object classs in c# 2.0 Pin
Ravi Bhavnani11-Apr-10 18:46
professionalRavi Bhavnani11-Apr-10 18:46 
AnswerRe: object classs in c# 2.0 Pin
Abhinav S11-Apr-10 18:50
Abhinav S11-Apr-10 18:50 
AnswerRe: object classs in c# 2.0 Pin
dan!sh 11-Apr-10 19:09
professional dan!sh 11-Apr-10 19:09 
AnswerRe: object classs in c# 2.0 Pin
Pete O'Hanlon12-Apr-10 1:31
mvePete O'Hanlon12-Apr-10 1:31 
Questionform1.showDialog Pin
arun_pk11-Apr-10 18:16
arun_pk11-Apr-10 18:16 
AnswerRe: form1.showDialog Pin
Ravi Bhavnani11-Apr-10 18:43
professionalRavi Bhavnani11-Apr-10 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.