473,788 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3488
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***@vk arlsen.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***@vk arlsen.no
PGP KeyID: 0x2A42A1C2
Nov 17 '05 #3
"Lasse Vågsæther Karlsen" <la***@vkarlsen .no> wrote in message
news:en******** *****@tk2msftng p13.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******** *****@tk2msftng p13.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******** *****@tk2msftng p13.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******** *****@tk2msftng p13.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
5484
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 setup, it removes existing app.config on the target machines and if included, it overwrites the existing ones. I tried editing the msi package and removing the app.config file from the table but it did not work. Any
5
3487
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 by adding a WebReference, since it does not allow me to keep state (cookiecontainer) or to specify functions on the classes (like if i want to override the ToString() function on a class from my webservice). So the only way i can see how i can get...
3
3797
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 conditionally exclude files or classes from my Release builds? In old C++ we would use #ifdef ... #endif statements, but we don't have pragmas in C# (or don't seem to). Help?
3
1937
by: Finn J Johnsen | last post by:
Hi Dow do I get ndoc to ignore classes flagged with the attribute? Thanks, Finn Johnsen
1
2102
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
281
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? 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.
4
2889
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 our current extensive number of .Net 1.1 web apps convert to it. After a week's time I dont's mind the converted app code that was broken and had to be changed, due to deprecation, new framework classes (some of which have names identical to...
0
1310
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 classes are being excluded from the chm but this is resulting in broken links in declarations of other classes that inherit from or use this class. Is there any way to resolve this problem? I would like to retain the exclude tag on the classes.
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.