473,473 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Configuration settings

I encountered a problem, I can't define reference for a specific
configuration.
My project, like any other, has 2 configurations ("Debug" and "Release") In
the "Debug" configuration I use Nunit for testing, so all nunit related code
is under #if NTEST definition. The NTEST declared only in Debug
configuration. However, in order to use NUnit I have to add reference for
nunit.framework.dll. My problem is that I don't want to add this reference
in the release configuration. I don't want to put the dll to the client
machine. Do you know how can I define a reference for a specific
configuration? I think that reflection could help, but I'm not quite sure
how to do it. Please give me an advise if you know.
Nov 16 '05 #1
3 1858
I would recommend that you create a test harness that using NUnit to test
your components. Your components should not need a reference to NUnit. The
test application should create instances of your objects, do the necessary
testing and error trapping.

That's what I do and it works well.

--

Chris Rolon

This posting is provided "AS IS" with no warranties, and confers no rights.

"Boris" <t_*****@list.ru> wrote in message
news:uf**************@TK2MSFTNGP11.phx.gbl...
I encountered a problem, I can't define reference for a specific
configuration.
My project, like any other, has 2 configurations ("Debug" and "Release") In the "Debug" configuration I use Nunit for testing, so all nunit related code is under #if NTEST definition. The NTEST declared only in Debug
configuration. However, in order to use NUnit I have to add reference for
nunit.framework.dll. My problem is that I don't want to add this reference
in the release configuration. I don't want to put the dll to the client
machine. Do you know how can I define a reference for a specific
configuration? I think that reflection could help, but I'm not quite sure
how to do it. Please give me an advise if you know.

Nov 16 '05 #2
You don't have to deploy the NUnit framework to your clients. So long
as none of the NUnit tests don't called then the assembly doesn't need
it. You can explicitly exclude the NUnit assembly in your setup
project (it you use one).

But I don't think you can change this for different configurations.

Adam
Nov 16 '05 #3
Boris wrote:

I encountered a problem, I can't define reference for a specific
configuration.
My project, like any other, has 2 configurations ("Debug" and "Release") In
the "Debug" configuration I use Nunit for testing, so all nunit related code
is under #if NTEST definition. The NTEST declared only in Debug
configuration. However, in order to use NUnit I have to add reference for
nunit.framework.dll. My problem is that I don't want to add this reference
in the release configuration. I don't want to put the dll to the client
machine. Do you know how can I define a reference for a specific
configuration? I think that reflection could help, but I'm not quite sure
how to do it. Please give me an advise if you know.


Rather than include the test fixture code directly in your project, the
recommended way is to create a secondary project and put all the fixtures in
that, and have that project reference nunit.

Then, have the test fixture project only included in the debug build.
Nov 16 '05 #4

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

Similar topics

1
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
7
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
5
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want...
5
by: Allan Ebdrup | last post by:
I have a webservice in ASP.Net 2.0, I need to store and load a xml configuration file in relation to one of the web methods in my webservice. What's the best place to store and the best way to load...
4
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An...
2
by: Jan Eliasen | last post by:
Hi I am having some problems reading configuration values from a configuration file, using C# 2.0. I have programmed a Windows Service, and this part goes well - it runs nicely. Now, the...
2
by: remya1000 | last post by:
i'm using VB.NET 2003. Last time while i did a program in Vb.Net 2005, i use "Configuration". and i could read and write to that XML configuration file like the example below. CODES:...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.