Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

where to set a development variable?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 06 Mar 2008 01:05 GMT
In my windows apps I always set a global development variable so that I can
toggle certain blocks of code back and forth between production and
development settings. I'll run some startup code that sets something like
DevVar = TRUE or DevVar = FALSE and then do this in code where needed:

If DevVar Then
   ....do something
ELSE
  ... do something else
END IF

I have no idea where to set something like (web.config, some global vb code
unit???) that in an asp.net 2.0 app and what it would be (session var??).
Looking for any advice.

Thanks,

Keith
Mark Rae [MVP] - 06 Mar 2008 01:14 GMT
> Looking for any advice.

http://www.google.co.uk/search?hl=en&rlz=1T4GZEZ_en-GBGB252GB252&q=ASP.NET+%22co
nditional+compilation%22&meta
=

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Keith G Hicks - 06 Mar 2008 02:32 GMT
This is pretty much what I was looking for:

<configuration>
 <!-- application specific settings -->
 <appSettings>
     <add key="connString" value="connection string" />
 </appSettings>

 <system.web>
    ...
 </system.web>
> In my windows apps I always set a global development variable so that I can
> toggle certain blocks of code back and forth between production and
[quoted text clipped - 14 lines]
>
> Keith
Mark Rae [MVP] - 06 Mar 2008 09:27 GMT
>> In my windows apps I always set a global development variable so that I
>> can
[quoted text clipped - 19 lines]
>     ...
>  </system.web>

OK, but that's actually not what you asked for... You asked for a method to
use a variable to toggle *blocks of code*, and even gave an example of it,
which is why I gave you the Google link for articles on how to do
conditional compilation in ASP.NET...

If you are now saying that you want to be able to use, essentially,
different web.configs for development / production etc, then you need this:
http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project
-support-released.aspx


Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.