Skip to main content
Question

COBOL .NET and namespaces

  • December 9, 2025
  • 1 reply
  • 27 views

Neil Hayes
Forum|alt.badge.img+1

Visual COBOL 11, COBOL .NET, .NET Core -  using methods.

When using namespaces why use:

       $set ilusing "System.Collections.Generic"

Over right clicking on the project, properties ~Namespaces or visa versa?

The $set places it in the code vs properties~Namespaces setting it in the project.

I think the $set is more visible personally at a developer level, 

But properies~Namespaces might be better for Pipelines. (Easier to pick up dependencies)

What is the benefit of either method?

Neil

1 reply

Chris Glazier
Forum|alt.badge.img+3

Hi Neil,

Personally, I think putting the ilusing directive, (or any directive for that matter), directly in the source makes it harder to maintain, especially if you have a large number of programs. If you need to add a new namespace, you would need to modify every program that requires it instead of just adding it once to the project where it would be used by all programs in the project.

You of course could also add this to a COBOL.DIR file or directives.mf, or one of the many other ways of specifying directives, so they are completely external to the program or project.

Just my opinion though…