473,800 Members | 3,038 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 3489
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
5486
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
3488
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
2892
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
9690
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
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
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
10273
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
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7574
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
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
5469
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...
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.