System.ArgumentOutOfRangeException occurs during build

.NET obfuscator and automated error reporting

System.ArgumentOutOfRangeException occurs during build

Postby chris3254902 » Mon Mar 17, 2014 11:54 am


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:

Code: Select all
[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.:

Code: Select all

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

Any ideas?

Posts: 2
Joined: Mon Mar 17, 2014 11:43 am

Postby chris3254902 » Tue Mar 18, 2014 11:33 am

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.
Posts: 2
Joined: Mon Mar 17, 2014 11:43 am

Postby Chris.Allen » Tue Mar 18, 2014 2:28 pm


"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
Posts: 579
Joined: Thu Mar 12, 2009 3:17 pm

Re: System.ArgumentOutOfRangeException occurs during build

Postby CSXPJC » Thu Oct 23, 2014 10:42 am

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.
Posts: 9
Joined: Fri Aug 27, 2010 10:18 am

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests