TypeConverters aren't available in v4 Designer

Posts   
 
    
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 03-Dec-2013 12:54:35   

I have a TypeConverter that I've been using since v3.x. I added it into the standard TypeConverter project and replaced the dll in the TypeConverters folder. After moving to v4 (both 4.0 and 4.1), none of the TypeConverters are available in the designer.

I've tried several different things such as compiling to x64 and compiling with .NET v4 but none of them have helped.

I am using the stand-alone designer and am running on Windows 7 x64. Visual Studio 2012 and 2013 are both installed so I've got .NET framework 4.5.1.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Dec-2013 14:11:16   

What does the application output window say? it shows an error if it can't load a dll. In the designer you can also see which types are found under 'tools'

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 03-Dec-2013 14:47:57   

The application output shows that the dll and type converters are loaded successfully. In the example below, I am using an "Additional type converter folder" through the project settings. However, the same result happens when I use the TypeConverters in the LLBLGen application directory.

TypeConverterLoader::Successfully instantiated type converter 'SD.LLBLGen.Pro.TypeConverters.CharTrimConverter' from assembly file 'C:\VS-Projects\iAPECS\DAL-DB2\DB2-TypeConverters\SD.LLBLGen.Pro.TypeConverters.dll'.

It also shows the dll under Tools.

However, the designer always shows "<none>" under TypeConverter to Use.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Dec-2013 14:52:04   

Type converters are only listed if they apply to the mapping at hand. So the mapping has an error and you need to specify the type converter but it's not listed? Could you give more specifics about the type converter (e.g. give one in sourcecode) so we know what we talk about exactly? There are too many unknowns now (what types are in play, what's the core type of the type converter etc.)

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 03-Dec-2013 16:26:07   

Before we go any further. My TypeConverters project/dll was using the v3.x source code. Do I need to re-create it using the v4.x source code? I hadn't thought about that yet.

As for an example. I have a field with the following definition: .NET Type - System.String DB Type - CHAR(1)

I would expect to be able to select the BooleanCharYNConverter for this field but no converters are available.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 03-Dec-2013 20:38:36   

Before we go any further. My TypeConverters project/dll was using the v3.x source code. Do I need to re-create it using the v4.x source code

What 3.x source code?

In general TypeConverters don't need a reference to either the generated code, nor the LLBLgen assemblies.

They should be just classes to convert between dataTypes.

jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 04-Dec-2013 00:34:18   

I mean that I added one additional type converter class to the LLBLGenPro source code project named TypeConverters.csproj (LLBLGen_Pro_v4.0_SourceCode\TypeConverters\TypeConverters.csproj)

However, I don't see that new class, nor any of the other typeconverter classes from that assembly when I am working in the designer.

If I remove the dll from the TypeConverters folder, LLBLGen will stop the project from loading and say that it cannot find my TypeConverter class. If I put the dll back in the TypeConverters folder, the project will open correctly. However, the TypeConverter does not appear as an available option on the list in the designer on the field mappings tab.

I can run an Element Search query that assigns the type converter to any field(s) and it functions correctly at runtime. I just can't assign it directly in the GUI.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Dec-2013 07:24:28   

You will see the TypeCoverter on the mappings sub-tab, if the TypeConverter matches with the transformation it needs, so the DB type matches the .net type.

What do you TypeConverter do? Did you specify a TypeConverter definition in your project?

At this point, it would help if you attach your .llblgenproj file and your TypeConverter code, and describe in which field are you trying to apply it. You can open a new Helpdesk thread (which is private).

David Elizondo | LLBLGen Support Team
sparq
User
Posts: 63
Joined: 14-Mar-2010
# Posted on: 21-Dec-2017 22:26:31   

jovball wrote:

I mean that I added one additional type converter class to the LLBLGenPro source code project named TypeConverters.csproj (LLBLGen_Pro_v4.0_SourceCode\TypeConverters\TypeConverters.csproj)

However, I don't see that new class, nor any of the other typeconverter classes from that assembly when I am working in the designer.

If I remove the dll from the TypeConverters folder, LLBLGen will stop the project from loading and say that it cannot find my TypeConverter class. If I put the dll back in the TypeConverters folder, the project will open correctly. However, the TypeConverter does not appear as an available option on the list in the designer on the field mappings tab.

I can run an Element Search query that assigns the type converter to any field(s) and it functions correctly at runtime. I just can't assign it directly in the GUI.

Hi there,

Did you ever find out the problem? I have this exact same thing happening in 5.3

sparq
User
Posts: 63
Joined: 14-Mar-2010
# Posted on: 21-Dec-2017 22:50:50   

sparq wrote:

Did you ever find out the problem? I have this exact same thing happening in 5.3

I have solved the problem by manually editing the XML file (.llblgenproj file)

Surely this isn't how you're supposed to specify type converters though.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-Dec-2017 09:33:29   

sparq wrote:

jovball wrote:

I mean that I added one additional type converter class to the LLBLGenPro source code project named TypeConverters.csproj (LLBLGen_Pro_v4.0_SourceCode\TypeConverters\TypeConverters.csproj)

However, I don't see that new class, nor any of the other typeconverter classes from that assembly when I am working in the designer.

If I remove the dll from the TypeConverters folder, LLBLGen will stop the project from loading and say that it cannot find my TypeConverter class. If I put the dll back in the TypeConverters folder, the project will open correctly. However, the TypeConverter does not appear as an available option on the list in the designer on the field mappings tab.

I can run an Element Search query that assigns the type converter to any field(s) and it functions correctly at runtime. I just can't assign it directly in the GUI.

Hi there,

Did you ever find out the problem? I have this exact same thing happening in 5.3

Does the application output window state an error? It will log errors with files being probed. You placed the dll in the type converters folder of the designer installation folder or in the folder specified as additional type converter folder in the project settings? If your type converter has additional dependencies, these dlls have to be in that folder too, otherwise the designer can't load the types. Also, the type converter has to be compiled on .NET full, as it has to be loadable by .NET full.

Frans Bouma | Lead developer LLBLGen Pro
sparq
User
Posts: 63
Joined: 14-Mar-2010
# Posted on: 26-Dec-2017 20:55:26   

Otis wrote:

Does the application output window state an error? It will log errors with files being probed. You placed the dll in the type converters folder of the designer installation folder or in the folder specified as additional type converter folder in the project settings? If your type converter has additional dependencies, these dlls have to be in that folder too, otherwise the designer can't load the types. Also, the type converter has to be compiled on .NET full, as it has to be loadable by .NET full.

It really has the except same symptoms as the issue described by "jovball". No errors in output window:

TypeConverterLoader::Successfully instantiated type converter '...'
Project File I/O::Project '...' loaded successfully

The type converters work fine in the generated project but I can't select them in the designer dropdown (though they will display when already used - I just can't assign any new type converters). If I remove the DLL from the specified folder an error is displayed. If I edit the XML project file manually I can assign type converters.

Bottom line - everything is working except the ability to select a type converter in the designer dropdown.

I am also using Windows 7 64bit (work PC - can't change that) with VS2017 and .NET frameworks 4-4.7 installed.

I assume by .NET "full" you mean .NET Framework (as opposed to CE/core/standard/etc). So yes the .NET Framework is installed and used.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 27-Dec-2017 10:11:17   

Ok and if you open the 'Tools -> View loaded external types' dialog, does your type converter you can't select, show up in that list? (Under 'type converter')

If so, it might be the type it reports it is for isn't matching the one in your project. Please open a helpdesk thread where you attach your llblgenproj and type converter dll with the type converter you can't select (and the ones used in the project), plus the typeconverter sourcecode, plus a remark about which field you want to assign the type converter on (so we can test it in the debugger to see what's happening) and we'll have a look.

Frans Bouma | Lead developer LLBLGen Pro
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 29-Dec-2017 19:45:43   

I dropped this at the time and then came back to it for v5. I worked that issue via a HelpDesk request so you won't find it in the forum. Usually I circle back around to the original post but I forgot to do it for this one.

The problem turned out to be that my converter was using SystemTypeConverterBase as a base class rather than TypeConverter.

It should be this.


    public class MyConverter : TypeConverter

I was doing this.


    public class MyConverter : SystemTypeConverterBase

Hope that helps with your current problem.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 30-Dec-2017 10:25:07   

Thanks for sharing, that's indeed something to be aware of simple_smile

Frans Bouma | Lead developer LLBLGen Pro