emerbrito / ILMerge-MSBuild-Task

Adds ILMerge to Visual Studio 2013/2017 or automated builds. This Task is intended to work right out of the box however, it supports a configuration file where you can control every ILMerge property including the list of assemblies to be merged.
MIT License
54 stars 15 forks source link

Cannot find ILMerge executable #13

Closed bassettb closed 5 years ago

bassettb commented 6 years ago

It is unable to find my ilmerge package. Nuget packages can be stored under C:\Users\%USERNAME%.nuget\packages It might also be one level deeper under a version folder, like "packages\ilmerge\2.13.307"

emerbrito commented 6 years ago

If both packages: "ILMerge-MSBuild-Task" and "ILMerge" are under the same "packages" folder, the build task should be able to resolve it, for example:

image

In above scenario it doesn't matter where "packages" is located, as long as your Visual Studio solution is aware of it and "ILMerge-MSBuild-Task" is running from there.

If you are still experiencing issues, please send your build log, it may help me narrow it down.

TheGoctor commented 6 years ago

I'm also seeing this. Build output shows:

Task lib location: C:\Users\%USERNAME%\.nuget\packages\ilmerge.msbuild.task\1.0.3\tools
Package location: C:\Users\%USERNAME%\.nuget\pacakges\ilmerge.msbuild.task
No folder starting with 'ILMerge' were found under C:\Users\%USERNAME%\.nuget\packages\ilmerge.msbuild.task.
...

By looking at ExeLocationHelper.cs, I can see it's only going up two levels from the Task lib location on line 134.

Sorry, I don't have time to open a PR myself, but hopefully that gives someone else a head start.

M-Pixel commented 6 years ago

Nuget changed its package layout since @emerbrito posted that screenshot - now instead of packages\assembly.version\tools\..., we have packages\assembly\version\tools\.... It's now necessary to go 3 levels up instead of 2, for that reason.

gabbyrozow commented 6 years ago

This issue still seems to be a problem. It works when the ILMerge nuget used is version 2.14.1203, but breaks with this error in more current versions for some reason

emerbrito commented 5 years ago

My apologies. My delay is due to email notifications issues that I hope I fixed for good this time. Are you still experiencing this? I just tested it with the latest ILMerge package (3.0.21) and the latest extension version and it worked just fine.

If it is still an issue could you please provide me more details on how I can reproduce it so I can work on it ASAP? Please include versions of vs, .net framework and packages you are using.

Ahmed-Elrayes commented 5 years ago

well i got this issue for the latest Version of ILMerge check the pic in number 2 , when u download it from NuGet the ILMerge.exe is in a wrong folder it inside packages\ILMerge.3.0.21\tools\net452 but it should be like Number 1 packages\ILMerge.3.0.21\tools when i copied it and pasted inside the correct destination it worked image 2

gabbyrozow commented 5 years ago

Thanks for getting back to me. I still haven't had a chance to check it out but will do so when I can.

Thanks for the info.

Gabby

On Sun, Dec 2, 2018 at 8:39 PM Ahmed Elrayes notifications@github.com wrote:

well i got this issue for the latest Version of ILMerge check the pic in number 1 , when u download it from NuGet the ILMerge.exe is in a wrong folder it inside packages\ILMerge.3.0.21\tools\net452 but it should be like Number 2 packages\ILMerge.3.0.21\tools when i copied it and pasted inside the correct destination it worked [image: image 2] https://user-images.githubusercontent.com/30704271/49343460-42aae200-f672-11e8-9808-f2d06bb0a96f.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/emerbrito/ILMerge-MSBuild-Task/issues/13#issuecomment-443531408, or mute the thread https://github.com/notifications/unsubscribe-auth/AVweE8QH8iOuMUPVnizP6bw24SHUKhUiks5u1B5JgaJpZM4S9-Zn .

Ahmed-Elrayes commented 5 years ago

it's ok am glad that i can help

xuxuedong commented 5 years ago

@emerbrito when i use vs2017 + ilmerge 3.0.21 + msbuild.ilmerge.task 1.0.5, it has following error "system.io.filenotfoundexception: cannot find ilmerge executable."

Ahmed-Elrayes commented 5 years ago

@emerbrito when i use vs2017 + ilmerge 3.0.21 + msbuild.ilmerge.task 1.0.5, it has following error "system.io.filenotfoundexception: cannot find ilmerge executable."

i guess this might fix your issue https://github.com/emerbrito/ILMerge-MSBuild-Task/issues/13#issuecomment-443531408

cnrat commented 5 years ago

well i got this issue for the latest Version of ILMerge check the pic in number 2 , when u download it from NuGet the ILMerge.exe is in a wrong folder it inside packages\ILMerge.3.0.21\tools\net452 but it should be like Number 1 packages\ILMerge.3.0.21\tools when i copied it and pasted inside the correct destination it worked image 2

This issue still not be fixed. Thanks to this walk around.

ltrzesniewski commented 5 years ago

The ILMerge NuGet package sets a $(ILMergeConsolePath) property which ILMerge.MsBuild.Task could use to locate the tool.

emerbrito commented 5 years ago

I tried several times but I still cannot reproduce what was described here (comment). Every time I install the package it goes to the expected folders.

I will try to improve the way it locates the executable in order to avoid this.

emerbrito commented 5 years ago

The ILMerge NuGet package sets a $(ILMergeConsolePath) property which ILMerge.MsBuild.Task could use to locate the tool.

I will look into this. Meanwhile to anyone experiencing issues, there is an property in the configuration file where you can also manually specify the path of your ilmerge executable (as a last resort): "AlternativeILMergePath":

https://github.com/emerbrito/ILMerge-MSBuild-Task/wiki/Config-File

emerbrito commented 5 years ago

Moving forward we will use $(ILMergeConsolePath) as suggested by @ltrzesniewski since it can always provide the exact location of the executable. Please refer to issue "#23 - Improve the way ilmerge executable is located" for more details.

There you will also find screenshots, logs and examples where the build task was able to successfully find the executable under different scenarios including the ones mentioned here.

This will be available on v1.0.5.

emerbrito commented 5 years ago

Shipped with v1.0.5.