You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error in ILMerge can occur when using the build task multiple times in the same build.
In our case we had about 10 projects in a solution that needed to be merged individually. As the build task loads the ILMerge assembly once into the build process and ILMerge uses statics this can lead to the error Key needs to be greater than 0 explained in more detail in the referenced issue.
Our workarround was to turn on BuildInParallel and setting -maxcpucount > 1 which reduced the number of merge operations per msbuild process.
As
it [ILmerge] was definitely written as a console application that would run once and then terminate.
I would suggest a) allow the option to spawn a new ILMerge process per merge operation or b) load ILMerge into a secondary AppDomain and unload it after the merge or c) maybe consider a upstream fix if possible.
This issue has caused us quite some pain as builds were failing seemingly randomly so I hope someone else finds this and can save themselves some headache.
The text was updated successfully, but these errors were encountered:
Thanks a bunch for investigating the issue and taking the time to post it here.
I went trough the ticket you provided in the ILMerge project and it is very helpful - looks like you guys covered it in details in there.
I will see what I can do here and get back to you.
Thats great to hear. Even though we are using multiple msbuild processes now yesterday we ran into the error again. Good thing is this led us to do an overdue depenency reorganization which reduced the amount of merging work but still would be great to know this is solved for good at some point :)
This error in ILMerge can occur when using the build task multiple times in the same build.
In our case we had about 10 projects in a solution that needed to be merged individually. As the build task loads the ILMerge assembly once into the build process and ILMerge uses statics this can lead to the error
Key needs to be greater than 0
explained in more detail in the referenced issue.Our workarround was to turn on
BuildInParallel
and setting-maxcpucount
> 1 which reduced the number of merge operations per msbuild process.As
I would suggest a) allow the option to spawn a new ILMerge process per merge operation or b) load ILMerge into a secondary AppDomain and unload it after the merge or c) maybe consider a upstream fix if possible.
This issue has caused us quite some pain as builds were failing seemingly randomly so I hope someone else finds this and can save themselves some headache.
The text was updated successfully, but these errors were encountered: