System.ArgumentOutOfRangeException occurs during build

chris3254902chris3254902 Posts: 3
edited October 23, 2014 6:42AM in SmartAssembly

I recently purchased SmartAssembly and am having a problem building one out of three of my .saproj files on one PC, but not on another.

I have my code and the three .saproj files checked into version control (so the saproj files are identical on both PCs). On one PC (windows 7), I can build the three saproj files without problems. On another PC (windows server 2008 r2), I can build two of the saproj files but the third fails:
[11:46:28][Step 4/4] System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
[11:46:28][Step 4/4] Parameter name: index
[11:46:28][Step 4/4]    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
[11:46:28][Step 4/4]    at System.ThrowHelper.ThrowArgumentOutOfRangeException()
[11:46:28][Step 4/4]    at System.Collections.Generic.List`1.get_Item(Int32 index)
[11:46:28][Step 4/4]    at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
[11:46:28][Step 4/4]    at ?.?. (IList`1 , Int32 )
[11:46:28][Step 4/4]    at ?.?. (  , IList`1 )
[11:46:28][Step 4/4]    at ?.?. (  )
[11:46:28][Step 4/4]    at  . . ()
[11:46:28][Step 4/4]    at ?.?. (  )
[11:46:28][Step 4/4]    at ?.?. (  )
[11:46:28][Step 4/4]    at ?. . ()

I get this error whether I run from the command line (as above) or I run from the SA gui.

I have looked at the .saproj files in a text editor, and they all contain relative paths to the dlls to be obfuscated, e.g.:

The dlls exist at the same relative paths on both PCs (though different absolute paths).

Any ideas?



  • The difference between the two machines is one (build successful) was using developer license while the other (build failed) was using server license.

    If I swap the licenses, the problem swaps too. I.e. on both machines, I cannot build with the server license but I can build with the developer license.
  • Hi.

    "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. "
    is a well-known issue (internal reference SA-1661) but it's *cause* has never been worked out.

    I've never know the license type to cause an issue but I'm willing to believe that it is the cause of this one.

    I've opened up a support ticket for you and I'll pursue this case through the ticket. ... kets/15249
  • I encounter this error when turning on "Control Flow Obfuscation" for my main assembly and setting it to any value other than "None".

    In the instance where I see this I am trying to obfuscate an assembly which references two others; one I am merging and the other I am embedding. I can turn on "Control Flow Obfuscation" for the embedded assembly and set it to maximum strength but, as mentioned above, if I turn it on for the main assembly I get an ArgumentOutOfRangeException.

    I have used the "send error report" feature in SmartAssembly to submit the error I have encountered.

    I am using SA Professional.
Sign In or Register to comment.