Bug Report B131164
Visible to All Users

Length cannot be less than zero parameter name: Length

created 16 years ago

when i try to drop a textedit control or memoedit on a windows form or dxform it throws
"Length cannot be less than zero parameter name: Length" error and fails to create the control on the form
Steps to Reproduce:
when i try to drop a textedit control or memoedit (timeedit,trackbarcontrol etc) on a windows form or dxform it throws
"Length cannot be less than zero parameter name: Length" error and fails to create the control on the form
Actual Results:
when i try to drop a textedit control or memoedit on a windows form or dxform it throws
"Length cannot be less than zero parameter name: Length" error and fails to create the control on the form
Expected Results:
create the control on the form

Show previous comments (3)
DevExpress Support Team 16 years ago

    Hi,
    Our developers need additional time to research this issue. We'll post an answer ASAP.
    Thank you

    DevExpress Support Team 16 years ago

      Hi,
      Thank you for your report. We've reproduced this problem.
      Thank you, Marina

      DevExpress Support Team 16 years ago

        Hi,
        Let me explain how the XAML Toys add-in works. You drop a control onto the Form, and assemblies are added to your project. The XAML Toys add-in parses the assembly name. Our design-time assemblies have short names, i.e. DevExpress.XtraEditors.v8.3.Design. However, the XAML Toys parses an assembly name as if it is a full name:

        Visual Basic
        Private Shared Function CurrentDomain_AssemblyResolve(ByVal sender As Object, ByVal args As ResolveEventArgs) As Assembly Dim strFileName As String = String.Empty If args.Name.Contains("\") Then strFileName = args.Name Else strFileName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location), args.Name.Substring(0, args.Name.IndexOf(","c)) + ".dll")'<-------------Error! End If If System.IO.File.Exists(strFileName) Then Return Assembly.LoadFrom(strFileName) ElseIf Assembly.GetExecutingAssembly().FullName = args.Name Then Return Assembly.GetExecutingAssembly Else Return Nothing End If End Function

        Marked line is the cause of the exception. It's necessary to check whether the assembly name is full or short, for example:

        Visual Basic
        If args.Name.IndexOf(',') = -1 Then strFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location), args.Name + ".dll"); Else strFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location), args.Name.Substring(0, args.Name.IndexOf(',')) + ".dll"); End If

        Thank you, Marina

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.