473,383 Members | 1,866 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,383 software developers and data experts.

exclude classes from build process

hi list,

i have an c# project, which contains some additional classes (nunit
testclasses), which are not needed in a release build? is it possible to
exclude them in the release build process?

i dont want to put the nunit tests in another project, because then i
have to switch the access modifiers from internal to public for the
classes i want to test.

thanks,
marco
Nov 17 '05 #1
6 3458
Marco Zapletal wrote:
hi list,

i have an c# project, which contains some additional classes (nunit
testclasses), which are not needed in a release build? is it possible to
exclude them in the release build process?

<snip>

You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Nov 17 '05 #2
Marco Zapletal wrote:
hi list,

i have an c# project, which contains some additional classes (nunit
testclasses), which are not needed in a release build? is it possible to
exclude them in the release build process?

<snip>

You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Nov 17 '05 #3
"Lasse Vågsæther Karlsen" <la***@vkarlsen.no> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.


I'd recommend wrapping in #if TEST instead, and creating 2 new
configurations, a release and a debug with tests enabled. In the two new
configurations, define TEST, and set everything else up as their none test
counterparts. The reason I suggest this is that there are some optimisations
in the release build that I have seen trip up a release but not a debug
build. It doesn't happen often, come to think of it I don't think I've seen
it happen since VS2003 was released, but since you're shipping a release
build, you should test it.

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton

Nov 17 '05 #4
"Lasse Vågsæther Karlsen" <la***@vkarlsen.no> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.


I'd recommend wrapping in #if TEST instead, and creating 2 new
configurations, a release and a debug with tests enabled. In the two new
configurations, define TEST, and set everything else up as their none test
counterparts. The reason I suggest this is that there are some optimisations
in the release build that I have seen trip up a release but not a debug
build. It doesn't happen often, come to think of it I don't think I've seen
it happen since VS2003 was released, but since you're shipping a release
build, you should test it.

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton

Nov 17 '05 #5
thank you both for your answers...

regards,
marco
Tim Haughton wrote:
"Lasse V�gs�ther Karlsen" <la***@vkarlsen.no> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.

I'd recommend wrapping in #if TEST instead, and creating 2 new
configurations, a release and a debug with tests enabled. In the two new
configurations, define TEST, and set everything else up as their none test
counterparts. The reason I suggest this is that there are some optimisations
in the release build that I have seen trip up a release but not a debug
build. It doesn't happen often, come to think of it I don't think I've seen
it happen since VS2003 was released, but since you're shipping a release
build, you should test it.

Nov 17 '05 #6
thank you both for your answers...

regards,
marco
Tim Haughton wrote:
"Lasse V�gs�ther Karlsen" <la***@vkarlsen.no> wrote in message
news:en*************@tk2msftngp13.phx.gbl...
You could wrap the entire class in the file in a #if DEBUG clause. The
files would still be compiled but they would not contribute anything to
the final assembly.

I'd recommend wrapping in #if TEST instead, and creating 2 new
configurations, a release and a debug with tests enabled. In the two new
configurations, define TEST, and set everything else up as their none test
counterparts. The reason I suggest this is that there are some optimisations
in the release build that I have seen trip up a release but not a debug
build. It doesn't happen often, come to think of it I don't think I've seen
it happen since VS2003 was released, but since you're shipping a release
build, you should test it.

Nov 17 '05 #7

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

Similar topics

1
by: Rajesh Abraham | last post by:
I would like to Exclude MyApp.Exe.Config from my Setup Package as I don't want it to get overwritten during upgrade installation of my application. If I remove app.config while building the...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
3
by: Nevyn Twyll | last post by:
I have a bunch of test case classes (.cs) files in my executable. For security and bloat reasons, I don't want them to compile into a Release executable - only into a Debug build. How do I...
3
by: Finn J Johnsen | last post by:
Hi Dow do I get ndoc to ignore classes flagged with the attribute? Thanks, Finn Johnsen
1
by: VijayKani | last post by:
How to exclude files from a VS.Net project through code when they are built (especially in VB.Net and Asp.Net and C#) -- Thanks
0
by: Marco Zapletal | last post by:
hi list, i have an c# project, which contains some additional classes (nunit testclasses), which are not needed in a release build? is it possible to exclude them in the release build process? ...
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
0
by: GM | last post by:
Hello, I am using NDoc version 1.3.1 (MSDN documenter) to generate class documentation for my class libraries. I am using the <exclude/tag on the classes that should not be documented. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.