473,322 Members | 1,690 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,322 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 1367
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.