Exception in the dotNetProjectResolver.AddExternalReference

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 12 years ago by Alex
Version: 4.0.0274
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
I run into error in my application which can be easy reproduced in your test application

Run Quick Start .NET Language Relection sample and try to add reference to the attached assembly. Exeption is thrown in the dotNetProjectResolver.AddExternalReference -
An unhandled exception of type 'System.ExecutionEngineException' occurred in mscorlib.dll. Unfortunaly, I can't send you the source code for the dll ( we generate the dll at runtime from our metadata). But if you open it in the Lutz Reflector, you can see that it contains only simple type definitions.
There is nothing wromg with the assemly itself, it works perfectly in Visual Studio.
Could you please take a look?

Thanks
Alex

Comments (4)

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

First can you change VS to break on exceptions and dig down into the inner exceptions to see what the problem really is here? Sometimes it may be as simple as you didn't provide proper access to a dependent assembly.

If it is more complex then please email over the assembly you mentioned so we can try and load it here.


Actipro Software Support

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the Assembly via email.

I get this exception when loading:
Additional Information: The runtime has encountered a fatal error. The address of the error was at 0x7a0098f8, on thread 0xab0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

I haven't seen that before. I also tried just doing Assembly.LoadFile. It loads but when calling GetExportedTypes, it blows up with the same exception. So there definitely is some basic .NET issue with that assembly. Once you can call GetExportedTypes successfully on it, you should be able to load it fine in our product.


Actipro Software Support

Posted 12 years ago by Alex
Avatar
Thanks for looking into it.

Interesting that this assembly can be loaded without any problems in Lutz Reflector or Visual Studio Type Browser. After loading it shows ALL types perfectly and correctly!
Any ideas how it can work?
Also, this is a snippet of my code

try
{
   dotNetProjectResolver.AddExternalReference(fileName)
}
catch (Exception ex)
{
   LoggingService.Error(ex);
}
Even, as you can see we catch all exceptions, the program hangs up and we need to kill it. It looks like the .NET CLR gets corrupted.

Best regards
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I also saw Reflector loaded it fine which is what is baffling me. However run this code and you will see it blow up on the GetExportedTypes call:
Assembly a = Assembly.LoadFile(@"pathtoyourdll");
a.GetExportedTypes();


Actipro Software Support

The latest build of this product (v2020.1 build 0400) 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.