ILMerge-MSBuild-Task icon indicating copy to clipboard operation
ILMerge-MSBuild-Task copied to clipboard

Specify a custom ILMergeConfig.json file for different build configurations?

Open Shazwazza opened this issue 4 years ago • 1 comments

I can see that the ILMergeConfig.json is hard coded as a configuration file here:

https://github.com/emerbrito/ILMerge-MSBuild-Task/blob/master/ILMerge.MSBuild.Task/ILMerge.MSBuild.Task/build/ILMerge.MSBuild.Task.targets#L28

Would it be possible to change this to a variable that just has this by default as "ILMergeConfig.json" but it could potentially be set in the main csproj to be a different file? The reason is because we have a few different build configurations and are cross targeting so need a different ILMergeConfig.json per build configuration. Happy to help if this is possible

Shazwazza avatar Oct 06 '20 12:10 Shazwazza

i am having the same error, although the task was successfully initially before giving me the same error. Any solution for this, I am using vs2015 with .net 4.5.2 and

Severity Code Description Project File Line Source Suppression State Error The "MergeTask" task failed unexpectedly. System.IndexOutOfRangeException: Index was outside the bounds of the array. at ILMerge.MsBuild.Task.MergeTask.MergeAssemblies(String mergerPath, MergerSettings settings) in D:\Dev\Github\ILMerge-MSBuild-Task\ILMerge.MSBuild.Task\ILMerge.MSBuild.Task\MergeTask.cs:line 328 at ILMerge.MsBuild.Task.MergeTask.Execute() in D:\Dev\Github\ILMerge-MSBuild-Task\ILMerge.MSBuild.Task\ILMerge.MSBuild.Task\MergeTask.cs:line 167 at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() App Build

here is my confirm file

{
  "General": {
    "OutputFile": "$(ProjectDir)\\bin\\merged\\App.exe",
    "TargetPlatform": "v4",
    "KeyFile": "$(ProjectDir)\\App.snk",
    "AlternativeILMergePath": "E:\\Utilities\\ILMerge.3.0.29\\tools\\net452\\ILMerge.exe",
    "InputAssemblies": []
  },
  "Advanced": {
    "AllowDuplicateType": null,
    "AllowMultipleAssemblyLevelAttributes": false,
    "AllowWildCards": false,
    "AllowZeroPeKind": false,
    "AttributeFile": null,
    "Closed": false,
    "CopyAttributes": false,
    "DebugInfo": true,
    "DelaySign": false,
    "DeleteCopiesOverwriteTarget": false,
    "ExcludeFile": "",
    "FileAlignment": 512,
    "Internalize": false,
    "Log": false,
    "LogFile": null,
    "PublicKeyTokens": true,
    "SearchDirectories": [],
    "TargetKind": "WinExe",
    "UnionMerge": false,
    "Version": null,
    "XmlDocumentation": false
  }
}

oghenez avatar Feb 17 '21 05:02 oghenez