Skip to content
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

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

Open
Shazwazza opened this issue Oct 6, 2020 · 1 comment

Comments

@Shazwazza
Copy link

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

@oghenez
Copy link

oghenez commented Feb 17, 2021

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.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
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants