Command Line complie problem

W

Wing Siu

I have 2 classes, which depends on each other and in different namespace.
For example, ClassA need use ClassB, and Class B need use ClassA

And because of some reason, we cannot using VS.Net to compile the project
and only can using csc.exe

Any solution? Thanks
 
M

Marc Gravell

Well, classes x-ref'ing each other isn't an issue in the least - do you
perhaps mean assemblies? If so, that would be a circular reference,
which is a "Bad Thing". It will work (in fact 2 of the main MS dlls
(System and mscorlib IIRC) are circular), but it is better avoided.
Otherwise builds get fun. Lots of fun. More fun than you need.

I would suggest a bettern pattern that removes this need, typically a
3rd base assembly that both assemblies reference.

If this isn't what you mean, then just pass both classes to csc on the
command line.

Either way, namespaces should not be an issue here, as long as the
classes contain the appropriate "using" statements, or fully qualified
names.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top