New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error LGHT0001: Failed to compare two elements in the array. #4563
Comments
Please provide the exception stack that is provided with this error message. If you are building via MSBuild, the log file will have the stack information.
|
Exception Type: System.InvalidOperationException
|
|
I just wanted to report that this still happens with the latest 4.0 release:
|
This still happens in v4.0.2719.0
|
Yes, and it'll very likely continue to repro until the bug is marked
|
Is there anything I can do (aside from fixing the bug) to get this resolved?
|
You could debug into the code and provide more detail about exactly what the issue is and what your .wxs code is doing to hit it. That's one step less than fixing the bug yourself but should make it significantly easier to design the fix. At this point, it isn't exactly clear what is causing the issue.
|
I have tracked down the problem. It happens when two components have a File element with a non unique Name attribute value and a long name in the value. Example:
If the Name value contains a short name (<= 8 chars) the bug is not triggered. A workaround is to explicitly set the ShortName as following: So it seems the problem is related to the short name generation in combination with non unique Name values.
|
The problem is here: The Sort happens if there are at least 2 files with the same short file name. The problem is now that the IComparable implementation in the FileRow class has been comment out. Hence these elements cannot be compared. A temporary solution would be to stop sorting the ArrayList as it is only used for the error message.
|
Please see the following pull request for the proposed fix:
|
Is this Still an Issue? I'm getting the error with July 5 Wix 4.0 My Code is
I'm using a harvest project in VS2015 that contains the SilverMonkey.exe |
Yes, the issue is still |
What about the fix proposed by mberchtold? Or could we sort by the entire path of the file instead of short name? |
What should I have to be able to rebuild entirely wix4? VS2013 with C# and C++ features? Anything more? |
This issue also occurs if you use pre-processor variables:
I would've expected pre-processing to already have occurred, removing the unused XML (or, more accurately, ignoring the "duplicate" entry). In any event, for me at least, I simplified the above WiX XML and this is not a blocking issue for me. But just wanted to report my own findings. |
This code is being reimplemented completely differently in issue #6212 |
Hi @robmen , @Gerolkae , @fourpastmidnight , @wixbot , @SonnyAD I'm still facing this issue in the below versions.
Can you share the V4.0 download link which doesn't have this issue? |
Hi @robmen , I guess this issue is not fixed, can you share the stable V4 version download link? |
It's fixed in v4-preview.0. Get that from NuGet. |
Is there any option to build and generate msi from wix v4 project using wix dotnet tool? Thanks in advance. |
Is there any option to build and generate msi from wix v4 project using wix dotnet tool? Thanks in advance. |
The linker on v4.0.2220.0 throws this error:
light.exe(0,0): error LGHT0001: Failed to compare two elements in the array.
The bug did not exist in v4.0.2115.0.
The text was updated successfully, but these errors were encountered: