Posted 11 years ago by Erik Pepping - RADVenture B.V
Version: 4.0.0274
Platform: Services
Environment: Windows XP (32-bit)
We've updated our product to use this new/latest version (274) and we have noticed that the editor raises the following exception every time we move the mouse over some tokens.

Any ideas?

Ten minste één element in de bronmatrix kan niet naar het type doelmatrix worden geconverteerd.
bij System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
bij System.Collections.ArrayList.ToArray(Type type)
bij ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.a(IDomType A_0)
bij ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.a(IDomType A_0, String[] A_1, IDomType A_2, String A_3, DomBindingFlags A_4)
bij ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpContext.a(Document A_0, CompilationUnit A_1, DotNetProjectResolver A_2)
bij ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpContext.GetContextAtOffset(Document document, Int32 offset, CompilationUnit compilationUnit, DotNetProjectResolver projectResolver)
bij ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage.GetContext(SyntaxEditor syntaxEditor, Int32 offset, Boolean beforeOffset, Boolean forParameterInfo)
bij ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetSyntaxLanguage.a(DotNetLanguage A_0, SyntaxEditor A_1, Int32& A_2)
bij ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage.OnSyntaxEditorViewMouseHover(SyntaxEditor syntaxEditor, EditorViewMouseEventArgs e)
bij ActiproSoftware.SyntaxEditor.SyntaxLanguage.a(SyntaxEditor A_0, EditorViewMouseEventArgs A_1)
bij ActiproSoftware.SyntaxEditor.SyntaxEditor.b(EditorViewMouseEventArgs A_0)
bij ActiproSoftware.SyntaxEditor.EditorView.OnMouseHover(MouseEventArgs e)
bij ActiproSoftware.WinUICore.UIElement.ActiproSoftware.WinUICore.IInputElement.RaiseMouseHoverEvent(MouseEventArgs e)
bij ActiproSoftware.WinUICore.UIControl.OnMouseHover(EventArgs e)
bij System.Windows.Forms.Control.WmMouseHover(Message& m)
bij System.Windows.Forms.Control.WndProc(Message& m)
bij System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bij ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Some notes:
    After this exception the editor stops working.
    I could not reproduce under the shipped examples
    Is there any way I can "trap" this kind of exceptions to be able to continue working? It looks like it's a problem when trying to show the QuickInfo tooltip.

Comments (6)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Erik,

Can you try and make a simple repro project that shows this happening? If you can give us a way to repro it, we'll get a fix out as soon as possible.

Actipro Software Support

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
By the way, my guess from the stack trace it seems to be in a partial type's (from source code) GetInterfaces call. Perhaps one of the items there isn't an IDomTypeReference, which they all should be. So try duplicating it with whatever source types are loaded into the project resolver.

Actipro Software Support

Posted 11 years ago by Erik Pepping - RADVenture B.V
OK, after several attempts I think I know what's causing the problem.

The problem occurs when a DotNetProjectResolver has a copy of an existing class.

For an historical reason which is a little bit to long to explain here , the custom editor we use in our product , makes a new Document based on a copy of the original one.
So when editing you are really editing a copy of an existing document.

This used to work in .71 and we detected the problem in .74.

I've several time tried to reproduce the error under the example application and it's not so easy to reproduce. It happens but not 100% of the times and definitively it's not easy like copy/paste the class and that's it. I think there are some other issues involved which I ignore.

Important thing is that I was able to get the same problem after adding many classes to the DotNetProjectResolver. So it looks that also the DotNetProjectResolver needs to be with a big amount of classes to actually detect this bug. With the simple example, copy/paste of the class gives no error.

I am now trying to find a workaround in our product but maybe this rings a bell and you can with this extra information reproduce and identify the bug.

Thanks in advance.
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Erik,

I did some research and I believe that the method that it's blowing up in is related to getting the combined interfaces for some partial classes that have been merged. This method wasn't changes from build 271 through 274 though.

So as a hint on trying to repro it, I would make a couple partial class documents (that both are for the same class) and both say they implement various interfaces. Or maybe try one implementing interfaces and the other not, etc. See if that helps.

For instance:
public partial class TestClass : ICollection, IList {}
public partial class TestClass : IEnumerable {}
I believe we would need to debug this to sort out what is causing the exception though so the repro would be most helpful.

Actipro Software Support

Posted 10 years ago by Erik Pepping - RADVenture B.V

Finally, after several failed attempts, I was able to reproduce our problem in a "smaller" example.

I've sent the example that shows clearly (I hope) the bug to support@actipro.

Run the application and move the mouse to the IPageValidation interface.
At that point it gives an unrecoverable exception.

Here is a code summary (even smaller than the example shown).
Warning: Since Actipro does not support "merging" of partial classes in same "document" (they need to be in different documents) this code can't be used with copy/paste in the shipped example.

public class bo1 { public string property1; }

public partial class bo2 : bo1 , IMyInterface { 
  public string property1; 
  public void Method1() {} 

public partial class bo2  : bo1 { public string property2; }

[Modified at 09/15/2008 11:06 AM]
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Thanks for the repro project. We've implemented a fix and someone will email you with a preview build to try.

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.