Re: [Conditional] question
From: Marc Jennings (MarcJennings_at_community.nospam)
Date: 01/10/05
- Next message: Michael Groeger: "Re: create an event handler for control array in C#"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Memory question when returning an object from inside another object"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: [Conditional] question"
- Next in thread: Daniel Jin: "Re: [Conditional] question"
- Reply: Daniel Jin: "Re: [Conditional] question"
- Reply: Ken Kolda: "Re: [Conditional] question"
- Reply: Nick Malik [Microsoft]: "Re: [Conditional] question"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Michael Groeger: "Re: create an event handler for control array in C#"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Memory question when returning an object from inside another object"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: [Conditional] question"
- Next in thread: Daniel Jin: "Re: [Conditional] question"
- Reply: Daniel Jin: "Re: [Conditional] question"
- Reply: Ken Kolda: "Re: [Conditional] question"
- Reply: Nick Malik [Microsoft]: "Re: [Conditional] question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|