Previous | Index | Next 

[PRB] Structures with same name may be generated in the same .NET namespace

Two or more public Type…End Type blocks with same name may coexist in a VB6 application, provided that they are defined in different BAS modules. When these Type blocks are converted to .NET, however, they cause a compilation error because .NET requires that all project-level symbols have a unique name. For each duplicated Type block you’ll get a message similar to this one:

        structure 'XYZ' and structure 'XYZ', declared in 'filename.vb', 
        conflict in namespace 'namespace_name'.

VB Migration Partner doesn’t solve this error automatically and requires that you fix it manually by editing the VB6 code. This fix is usually a no-brainer, because if a VB6 project contains multiple Type blocks with same name, these blocks can be accessed only from inside the module where they are defined. (Any attempt to access them from a different module causes an ambiguous name compilation error in VB6.) For this reason you just need to change the scope of all Type blocks with same name from Public to Private.

 

Previous | Index | Next