Click here to Skip to main content
15,893,401 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I did some changes in code at many classes(in debug mode),now I want to release code on production(release) enviornment without that specific code change. There is way to do it but I am not getting exact way how to do it.

Please share if you know solution for the same.

Thanks,
Nagraj
Posted
Comments
Naik Nagraj 13-Apr-11 8:52am    
Thanks a lot!!!

Wrap the code in a conditional compilation block

http://msdn.microsoft.com/en-us/library/4y6tbswk.aspx[^]

#if DEBUG

   // Code here will only compile as part of Debug builds (DEBUG is defined)

#else

   // Code here will be compiled when DEBUG is not defined

#endif


DEBUG is defined by default in Debug builds under project -> properties -> Define DEBUG Constant
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 13-Apr-11 8:36am    
This is correct answer, a 5.
--SA
There is no way to do this. Unless you have a source control for your project.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Apr-11 8:36am    
Really?! Ha ha ha...
--SA
Pong D. Panda 13-Apr-11 22:22pm    
Its not what he wants. He said he created a code while in bedug mode and the working code was deployed earlier on Release mode. Im aware of the if DEBUG code, but its not what he wants. Thanks for downvoting my answer.
Sergey Alexandrovich Kryukov 14-Apr-11 13:14pm    
I see some difference between "he wants" and "he thinks he wants". Sorry, but in this case I can see only what you think he thinks he wants... And you also did not express this idea clearly. What do you think was deployed first, in what configuration, what was changed in either configuration and what features should be deployed to existing customer and future customers (the latter is very important, too, because it affects the state of development project).
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900