Re: [Conditional] question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Marc Jennings (MarcJennings_at_community.nospam)
Date: 01/10/05


Date: Mon, 10 Jan 2005 15:37:40 +0000

Thanks for that. I guess I would have seen this if I had read the
docs properly.

It's not a problem, though. I'll just have to go back to the old
switch(Environment.MachineName) kind of thing (Which I probably prefer
anyway...)

Thanks again, both responders...

On Mon, 10 Jan 2005 09:53:12 -0500, "Nicholas Paldino [.NET/C# MVP]"
<mvp@spam.guard.caspershouse.com> wrote:

>Marc,
>
> You aren't going to be able to do this. The reason is that the
>Conditional attribute is evaluated at compile-time, not run-time. It is
>strictly for pre-processor values, not environment values.
>
> If you want to do something based on the environment, you are going to
>have to write code that will detect the environment you are in, and then
>make the appropriate calls.
>
> Hope this helps.



Relevant Pages

  • Re: Strong AI Thesis (No Chinese room, I promise)
    ... reason then it is determined. ... of the red block and you ask why I might say its "intention" ... Actually I resist the idea that the environment controls ... predisposition towards becoming alcoholics. ...
    (comp.ai.philosophy)
  • Re: Mvbase or D3 on Microsoft Win 2003 SBS
    ... knew that was a reason I don't hang out with any business people! ... Conversion of an existing Pick ... environment to Pick flavour UV is about the smallest "conversion" step ... that's what I/we think about for any migration effort. ...
    (comp.databases.pick)
  • Re: threads
    ... > Tassilo v. Parseval ... >> The actual reason is the fact that Perl threads are interpreter threads, ... The reason is that for thread creation Perl uses a ... > completely unrelated problem in Win* environment) ...
    (comp.lang.perl.misc)
  • Re: [Full-Disclosure] viruses being sent to this list
    ... > requiring more time spent on moderation. ... that same reason even ISPs are ... I run a full non-windows environment since 1997 and I think it is ... If you fear that pranksters might fsck up your mailbox, ...
    (Full-Disclosure)
  • Re: Clearing memory from instantiated objects
    ... "Stefan Schulz" wrote in message ... > previously silent observer: ... only offered a reason why I don't offer a ... I cannot reproduce the exact environment ever again ...
    (comp.lang.java.help)