PC Review


Reply
Thread Tools Rate Thread

C# classpath equivalent?

 
 
jeremiah johnson
Guest
Posts: n/a
 
      3rd Apr 2006
Okay this is going to sound really dumb. Skeet, you can poke fun of me
in your own special way if you see fit.

Is there a way to reproduce the CLASSPATH functionality of Java within
C#? Would there ever be a reason to do this? Is there a reason *not*
to do this? There must be, I think, or there would probably be a
CLASSPATH environment variable.

I'm tired of typing /r:... at the command line. I have an IDE, and I
use it, but on some systems there is no IDE and when I want to make a
quick code change and recompile, there's no CLASSPATH to help me.

Why no CLASSPATH environment variable equivalent?
 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      3rd Apr 2006
jeremiah johnson <(E-Mail Removed)> wrote:
> Is there a way to reproduce the CLASSPATH functionality of Java within
> C#? Would there ever be a reason to do this? Is there a reason *not*
> to do this? There must be, I think, or there would probably be a
> CLASSPATH environment variable.
>
> I'm tired of typing /r:... at the command line. I have an IDE, and I
> use it, but on some systems there is no IDE and when I want to make a
> quick code change and recompile, there's no CLASSPATH to help me.
>
> Why no CLASSPATH environment variable equivalent?


One thing you can do is to use a custom response file if you find
yourself using the same references frequently. An example (and the one
used by default) is in the .NET framework directory - csc.rsp. You can
specify one on the command line by doing

csc @foo.rsp X.cs Y.cs etc

I don't know of any environment variables which do the same, but they
may be there.

Interestingly, these days I think Java developers tend to try to avoid
using the CLASSPATH environment variable, preferring to explicitly
specify the jars/paths on the command line. There are advantages and
disadvantages of both ways, however.

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
jeremiah johnson
Guest
Posts: n/a
 
      3rd Apr 2006
Jon Skeet [C# MVP] wrote:
> jeremiah johnson <(E-Mail Removed)> wrote:
>> Is there a way to reproduce the CLASSPATH functionality of Java within
>> C#? Would there ever be a reason to do this? Is there a reason *not*
>> to do this? There must be, I think, or there would probably be a
>> CLASSPATH environment variable.
>>
>> I'm tired of typing /r:... at the command line. I have an IDE, and I
>> use it, but on some systems there is no IDE and when I want to make a
>> quick code change and recompile, there's no CLASSPATH to help me.
>>
>> Why no CLASSPATH environment variable equivalent?

>
> One thing you can do is to use a custom response file if you find
> yourself using the same references frequently. An example (and the one
> used by default) is in the .NET framework directory - csc.rsp. You can
> specify one on the command line by doing
>
> csc @foo.rsp X.cs Y.cs etc
>
> I don't know of any environment variables which do the same, but they
> may be there.
>
> Interestingly, these days I think Java developers tend to try to avoid
> using the CLASSPATH environment variable, preferring to explicitly
> specify the jars/paths on the command line. There are advantages and
> disadvantages of both ways, however.
>


I didn't know about response files. Thanks a ton, Jon. This will save
me a lot of typing.
 
Reply With Quote
 
Vijay
Guest
Posts: n/a
 
      3rd Apr 2006
I have never done at command line... but just a thought, can't you keep a
batch file and just run it when you have no IDE?? I maybe way of line
here...

VJ

"jeremiah johnson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Okay this is going to sound really dumb. Skeet, you can poke fun of me in
> your own special way if you see fit.
>
> Is there a way to reproduce the CLASSPATH functionality of Java within C#?
> Would there ever be a reason to do this? Is there a reason *not* to do
> this? There must be, I think, or there would probably be a CLASSPATH
> environment variable.
>
> I'm tired of typing /r:... at the command line. I have an IDE, and I use
> it, but on some systems there is no IDE and when I want to make a quick
> code change and recompile, there's no CLASSPATH to help me.
>
> Why no CLASSPATH environment variable equivalent?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put something in the ClassPath ?? tmb Windows XP General 1 2nd Jun 2004 09:37 AM
Set classpath through GPO Peter van der Woude Microsoft Windows 2000 Group Policy 3 22nd Mar 2004 06:42 AM
CLASSPATH adrian Windows XP General 1 5th Dec 2003 07:36 AM
CLASSPATH Adrian Windows XP General 0 2nd Dec 2003 12:29 AM
CLASSPATH Adrian Windows XP General 1 1st Dec 2003 05:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:26 AM.