I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find.
I had a similar issue. The application would build and run in the IDE, but fail to publish; conking out at the 'merge dll into single assembly' stage. After researching aspnet_merge.exe I found that the issue was resolved by unchecking the 'emit debug information' checkbox in the publish options.
It may not be a 'clean' fix for the issue, but it's a workaround.
Hope this helps.
Andrew