By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

C# classpath equivalent?

P: n/a
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?
Apr 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
jeremiah johnson <na*******@gmail.com> 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 - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 3 '06 #2

P: n/a
Jon Skeet [C# MVP] wrote:
jeremiah johnson <na*******@gmail.com> 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. :)
Apr 3 '06 #3

P: n/a
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" <na*******@gmail.com> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl...
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?

Apr 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.