Can't seem to load enum type defined within another class; fails silently

Posts   
 
    
mmacdonald
User
Posts: 3
Joined: 07-Jun-2017
# Posted on: 07-Jun-2017 20:04:21   

Using LLBLGenPro 5.2, trying to load an enum type with a .typeimports file

With this .cs file


namespace ImportTypes
{
    public enum Class1
    {
      VALUE1,
      VALUE2,
      VALUE3
    }

    public class ClassWithInner
    {
      public enum InnerEnum
      {
        VALUEA,
        VALUEB,
        VALUEC
      }
    }
}

<typeImports>

 <typeImport typeName="ImportTypes.Class1" assemblyFile="C:\Projects\OrbitLogicInc.Data\source\OrbitLogicInc.Data\ImportTypes\bin\Debug\ImportTypes.dll"/>

 <typeImport typeName="ImportTypes.ClassWithInner+InnerEnum" assemblyFile="C:\Projects\OrbitLogicInc.Data\source\OrbitLogicInc.Data\ImportTypes\bin\Debug\ImportTypes.dll"/>

</typeImports>

The first enum imports fine with a success message in the application log;

TypeConverterStore::Successfully imported type 'ImportTypes.Class1' from assembly 'C:\Projects\OrbitLogicInc.Data\source\OrbitLogicInc.Data\ImportTypes\bin\Debug\ImportTypes.dll' defined in .typeimports file 'C:\Projects\OrbitLogicInc.Data\test.typeimports'.

the second enum fails to import but it is silent, there is no message in the log.

Note that the inner class fails either with ImportTypes.ClassWithInner.InnerEnum or ImportTypes.ClassWithInner+InnerEnum

Is this a known limitation and is this expected behavior?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 08-Jun-2017 12:05:48   

Hmm. the '+' should still lead to a type being loadable. We'll look into this to see if it picks up the type at all.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 09-Jun-2017 11:17:52   

I can't reproduce it when I add your inner enum to our test enums:


System::Initialization done. Ready.
TypeConverterStore::Successfully imported type 'EnumTypes.CategoryType' from assembly '\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\EnumTypes\bin\Debug\EnumTypes.dll' defined in .typeimports file 'C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\AdvancedQueryApis\LLBLGenPro Projects\.\Northwind26.llblgenproj.typeimports'.
TypeConverterStore::Successfully imported type 'EnumTypes.ClassWithInner+InnerEnum' from assembly '\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\EnumTypes\bin\Debug\EnumTypes.dll' defined in .typeimports file 'C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\AdvancedQueryApis\LLBLGenPro Projects\.\Northwind26.llblgenproj.typeimports'.
Project File I/O::Project 'Northwind26' loaded successfully


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EnumTypes
{
    public enum CategoryType
    {
        Beverages = 1,
        Condiments,
        Confections,
        DairyProducts,
        GrainsCereals,
        MeatPoultry,
        Produce,
        Seafood
    }

    public class ClassWithInner
    {
        public enum InnerEnum
        {
            VALUEA,
            VALUEB,
            VALUEC
        }
    }
}


<typeImports>
    <typeImport typeName="EnumTypes.CategoryType" assemblyFile="\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\EnumTypes\bin\Debug\EnumTypes.dll"/>
    
    <typeImport typeName="EnumTypes.ClassWithInner+InnerEnum" assemblyFile="\Myprojects\VS.NET Projects\LLBLGen Pro v5.2\UnitTests\LLBLGen Pro\EnumTypes\bin\Debug\EnumTypes.dll"/>
</typeImports>

You're sure the dll you mention in the typeimports file is indeed the one containing the inner enum?

Frans Bouma | Lead developer LLBLGen Pro
mmacdonald
User
Posts: 3
Joined: 07-Jun-2017
# Posted on: 12-Jun-2017 16:57:21   

It is in the same source file as the type that loads successfully, so it is in the same dll.

I don't see a significant difference between my test case that fails and yours that works. Maybe I have a problem I'm not seeing in the typeimports.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 12-Jun-2017 20:00:13   

Could be a previous build without the inner enum.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 13-Jun-2017 09:35:49   

If you can't find it, please attach an llblgenproj file (can be empty) with the dll and the typeimports file you have and we'll see if we can import the type from those files. I can't see anything wrong with the typeimports file you have...

Frans Bouma | Lead developer LLBLGen Pro
mmacdonald
User
Posts: 3
Joined: 07-Jun-2017
# Posted on: 13-Jun-2017 18:35:31   

InnerClass is working now--

I must have not tested properly with the + in the fully-qualified name for the inner class

Thanks for your help