Language Designer Tool Parser Debugger Unable to Find ILLPaser Implementation

SyntaxEditor for WPF Forum

Posted 3 months ago by Will Gauthier
Version: 21.1.3
Avatar

When I point the Language Designer tool's parser debugger to my dll, I get an error message saying, "No non-abstract classes that implement ILLParser and have a parameterless constructor were found in the assembly." I'm confident it should be picking up my LuaParser class, though.

This is what the class looks like:

public class LuaParser : LLParserBase, ILLParser
{
/// <inheritdoc />
public LuaParser()
: base(new LuaGrammar())
{
}

/// <inheritdoc />
public override ITokenReader CreateTokenReader(ITextBufferReader reader)
{
return new LuaTokenReader(reader, new LuaLexer(new LuaClassificationTypeProvider()));
}

/// <inheritdoc />
protected override IParseData CreateParseData(IParseRequest request, IParserState state)
{
var parseData = new LuaParseData();
this.InitializeParseData(parseData, state);

return parseData;
}
}

I've tried explicitly implementing ILLParser in addition to extending LLParserBase, opening the dll from both debug and release builds, and pointing the debugger to other dlls from the solution, all without success.

Comments (8)

Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Will,

The parser looks like it should be picked up ok.  Can you debug the LanguageDesigner.exe with Visual Studio and see if you get any exceptions when trying to load the .dll?  For instance, perhaps there's a caught exception occurring where your .dll relies on other dependency .dlls and those can't be found, so our code fails to find your type.  To resolve that particular issue, make sure all referenced .dlls for your parser's .dll are in the same folder.


Actipro Software Support

Posted 3 months ago by Will Gauthier
Avatar

I've done as you suggested, but I didn't encounter any exceptions with Visual Studio attached to LanguageDesigner, even with break when thrown checked for all exception types. The output window from Debug just shows a bunch of things being loaded then unloaded.

I still tried to ensure that all the referenced .dlls are in the same folder anyways. I turned on copy local for all the assemblies and projects under dependencies that I could, without any luck. What else can I try?

Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Will,

Hmm, I would have expected you to see some kind of exception occur if there was a problem loading the assembly.  Can you email our support address with a link to download the .dll and any of its dependencies in a .zip file, and we can try it here to see what's going on?


Actipro Software Support

Posted 3 months ago by Will Gauthier
Avatar

Ok, I sent an email with the source code attached as a .zip file. Hopefully you'll be able to figure out why the debugger isn't picking up my parser class.

Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Will,

I'm sorry but I haven't seen it come across so the mail server may have blocked the attachment due to there being binaries in the .zip file.  I'd recommend you upload it to a OneDrive or something similar and email us the link instead.  Thanks!


Actipro Software Support

Posted 3 months ago by Will Gauthier
Avatar

Alright, I tried again, this time with a OneDrive link like you suggested.

Answer - Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Will,

Thank you for the sample.  When the Language Designer goes to scan the assembly you load into the debugger, part of the criteria is that we are looking for a .NET Type that implements our ILLParser interface. 

In your scenario, it appears your assembly has references to customized versions of our source code assemblies.  I noticed that since the referenced packages had different names than our official ones and had Version="20.1.0.4".

When .NET loads the assembly, it handles the custom SyntaxEditor assembly references as different from the SyntaxEditor assemblies already loaded in the app's AppDomain, so our test of typeof(ILLParser).IsAssignableFrom() will not pass.  That's why your parser is not located by the app.

The workaround here for debugging support is to use the same "official" assembly versions as references in your language's project that the Language Designer app is using.  If you need to use customized assemblies in general, that's fine.  But you might need to make a special project just for debugging that references our official ones.  That should get you working.


Actipro Software Support

Posted 2 months ago by Will Gauthier
Avatar

Ah, I had no idea we were using customized versions of your source code assemblies. Thank you for digging in and finding that out.

I swapped them out for the official versions as you suggested and was able to debug my parser successfully. Thanks again!

The latest build of this product (v22.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.