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

Question About Config Manager

Ed
I'm relatively new to C# .Net (just as a warning ;-)).

I'm wanting to do two different builds of my .Net app, one for the full
retail the other for a simple trial that has a few nag screens and some
limitations on features.

I've set it up in my configuration manager in VS2003 to have one release
build and one "trialversion" build.

My question is how can I tell the difference in my code and have the
compiler not include pieces of code if it is being built with the
"trialversion" configuration?

I was able to do this relatively simplt in VC++ with the #ifdef's and the
like. Is there anything like that with C# .Net?

thanks in advance,
ed
Jul 27 '05 #1
2 1370
You can use the following syntax
#if _TRIALVERSION_

Condiional Code
#endif

You can define the Conditional Compilation Constraints under the Project ->
Properties -> COnfiguration Properties -> Build

Hope this helps

--
- Shuvro
SDE, MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"Ed" <Ed@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
I'm relatively new to C# .Net (just as a warning ;-)).

I'm wanting to do two different builds of my .Net app, one for the full
retail the other for a simple trial that has a few nag screens and some
limitations on features.

I've set it up in my configuration manager in VS2003 to have one release
build and one "trialversion" build.

My question is how can I tell the difference in my code and have the
compiler not include pieces of code if it is being built with the
"trialversion" configuration?

I was able to do this relatively simplt in VC++ with the #ifdef's and the
like. Is there anything like that with C# .Net?

thanks in advance,
ed

Jul 27 '05 #2
Ed
I had a feeling it would be something that simple. I just wasn't looking in
the right places I guess.

Thanks, Shuvro.

Ed

"Shuvro Mazumder [MSFT]" wrote:
You can use the following syntax
#if _TRIALVERSION_

Condiional Code
#endif

You can define the Conditional Compilation Constraints under the Project ->
Properties -> COnfiguration Properties -> Build

Hope this helps

--
- Shuvro
SDE, MSFT

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.

"Ed" <Ed@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
I'm relatively new to C# .Net (just as a warning ;-)).

I'm wanting to do two different builds of my .Net app, one for the full
retail the other for a simple trial that has a few nag screens and some
limitations on features.

I've set it up in my configuration manager in VS2003 to have one release
build and one "trialversion" build.

My question is how can I tell the difference in my code and have the
compiler not include pieces of code if it is being built with the
"trialversion" configuration?

I was able to do this relatively simplt in VC++ with the #ifdef's and the
like. Is there anything like that with C# .Net?

thanks in advance,
ed


Jul 28 '05 #3

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

Similar topics

2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
29
by: Greg | last post by:
Now can someone help me answer this question? Northwind Traders is a chain of department stores located around the country. It is setting up a new sales system cashiers will use to accept...
11
by: m.posseth | last post by:
Hi is it possible with formsauthentication to only protect certain parts of my website ? let say i have the following directory structure default.aspx logon.aspx
3
by: Henry | last post by:
I know it is possible to store dynamic propterties for applications in XML files. The app.config and the web.config files can be used to store AppSettings... I am just wondering how far one can...
8
by: Mike | last post by:
I just installed a VS 05 onto my new laptop, I can create a new web app, but when I goto Debug, I don't see Run without Debugging as an option, its only allowing me to run my web app in debug mode....
2
by: Jonn | last post by:
OK, I have VS 05 installed on 2 boxes and it was installed from the same DVD. One is a laptop and one is a desktop. On the desktop I can run a application without being in debug mode I select...
10
by: =?Utf-8?B?TUNN?= | last post by:
When creating a new VB Web Application Project with VS2008, there are several settings (compiler settings, option strict, etc) that appear both in the web.config file and "My Project". I'm...
7
by: eschneider | last post by:
I have a webservice which every time I build it keeps adding Crystal references into the web.config? <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral,...
3
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I cut and paste the following code from msdn help page which it just introduces view and multiview server controls. Here is what I do: in vs studio 2005, File --New Web Site, it...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...

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.