StackOverflow in DotNetProjectResolver.AddExternalReference

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 12 years ago by Edward
Version: 4.0.0246
Environment: Windows XP (32-bit)
Avatar
Hi,

I have noticed that a StackOverflowException always occurs when calling DotNetProjectResolver.AddExternalReference() with an assembly that has missing satellite assemblies.

Example, Assembly A is linked with Assembly B, if B does not exist near assembly A I have a StackOverflowException when calling DotNetProjectResolver.AddExternalReference(A).

My current work arround is to catch this exception.

Nice component anyway!

Regards,

Edward

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Edward,

If you'd like, send us a ZIP with a sample that we could load in the .NET Reflection QuickStart to see the exception. In any case, an exception should be thrown if it is unable to load the assembly, but perhaps we could wrap it with a better one.


Actipro Software Support

Posted 12 years ago by Edward
Avatar
Quote:
When I run it with our latest code we now throw an exception that describes the failure to load. [...] This new exception will provide a clearer message though in this scenario.


Ok I will use a try catch arround it before installing the 247 maintenance release.

Thank you for your strong and quick support.

Edward
Posted 12 years ago by Edward
Avatar
Hi,

I'm coming back on this issue because it the StackOverflowException is never catchable in most of cases. Now I'm stuck with such a behavior since there is no way to prevent our application crashing when the Syntax Addon encounters the dll that has missing satellites.

I guess you are calling
public AssemblyName[] GetReferencedAssemblies ()
from the assembly being reflected by AddExternalReference(), so why not just avoid reflecting a satellite assembly if it is not present on the file system?

Regards,

Edward
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Edward,

We're just calling the core .NET methods to load assemblies and aren't really doing anything special in that regard.

What would be best is if you could send us a ZIP containing an assembly that we can load into our .NET Reflection QuickStart to see the issue show up. Then we can debug it to see what is happening.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.