ApplicationException in AddExternalReference

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

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

When I load one of my assemblies with DotNetProjectResolver.AddExternalReference(), I get the following exception:
Quote:
System.ApplicationException was caught
Message="Could not load exported type data for assembly 'Cpt.Wrappers, Version=2.0.2649.24017, Culture=neutral, PublicKeyToken=null'."
Source="ActiproSoftware.SyntaxEditor.Addons.DotNet.Net20"
StackTrace:
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:
[System.Runtime.InteropServices.StructLayout(LayoutKind.Explicit)]
        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;

            [System.Runtime.InteropServices.FieldOffset(0)]
            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.

Regards,

Edward

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
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 (v2018.1 build 0341) was released 8 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.