ApplicationException in AddExternalReference

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 17 years ago by Edward
Version: 4.0.0259
Platform: .NET 2.0
Environment: Windows XP (32-bit)

When I load one of my assemblies with DotNetProjectResolver.AddExternalReference(), I get the following exception:
System.ApplicationException was caught
Message="Could not load exported type data for assembly 'Cpt.Wrappers, Version=2.0.2649.24017, Culture=neutral, PublicKeyToken=null'."
at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.a.a(c A_0)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.a.a(c A_0)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.AssemblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.AddExternalReference(String assemblyName)
at TestApplication.QuickStart.DotNetReflectionForm.ExecuteAppAction(AppAction action) in C:\Program Files\Actipro Software\WindowsForms\SyntaxEditor\v4.0.0258\TestApplication-CSharp.Net20\QuickStart\DotNetReflectionForm.cs:line 608

Since the exception seems to come from Assembly.GetExportedTypes() (seen in a previous topic), is there a way to call another API from .Net framework that doesn't crash?

The assembly which needs to be reflected implements unions fields as below:
        public struct d
            [System.Runtime.InteropServices.FieldOffset(0)] // Offset is 0 for both of the fields to make an union (adviced by the MSDN)
            public a ssString;

            public c ussdString;
Any idea for a work around that we could use here? Any sample code to reflect manualy an assembly?

Note: I marked this topic as Bug report to specify syntax editor and framework versions used here.



Comments (1)

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

Actually the only place that particular exception message is raised is in a try...catch around this line:
types = assembly.GetExportedTypes();
So what I suspect is that perhaps you are not loading some dependent assembly before you load this assembly that has the issue. Check out the load order and see if that helps.

Actipro Software Support

The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.