Problem with two version of program in one code and class referenc

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on one project but it has 2 version(A and B). In version B, its
function is the same as in version A, except there is some extend function
that will reference one class ( .dll file), for example C.dll.

What I want is when compile version A, the exe file will not has C.dll as
its reference? Can VB.NET do that?
 
hi Krich, what do you mean " is the same as in version A". If they are
the same
would require same references. It's not clear, can you produce a
simplified code?

Also consider revising your code organization, I have some impression
you are calling
for future troubles...

-tom

Krich ha scritto:
 
and the future is now.


hi Krich, what do you mean " is the same as in version A". If they are
the same
would require same references. It's not clear, can you produce a
simplified code?

Also consider revising your code organization, I have some impression
you are calling
for future troubles...

-tom

Krich ha scritto:
 
Krich said:
I am working on one project but it has 2 version(A and B). In version B, its
function is the same as in version A, except there is some extend function
that will reference one class ( .dll file), for example C.dll.

What I want is when compile version A, the exe file will not has C.dll as
its reference? Can VB.NET do that?

No.
The references are held in the Project File and this can't contain
Conditional Compilation directives like the Source code can so
"conditionally" removing a reference can't be done.

Does this actually matter?
I don't think so.

Since .Net programs are "compiled" on a /per-method/ basis at run-time,
having the reference there /shouldn't/ matter. It's only if your code
actually uses anything in the referenced assembly that things will go
wrong. With Conditional Compilation directives around the code you want
to exclude, the extra reference will simply be ignored.

If you /really/ feel the need to remove the reference in the cut-down
version, you'll need to set up parallel Solution and Project files (both
using the same source code) and comple each version separately.

HTH,
Phill W.
 
Back
Top