web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dll merging throwing an error.

(0) ShareShare
ReportReport
Posted on by 6

Hello All Guys,

I have four class libraries within one solution.

in first Class-library project , i am writing one post build event as below.

"C:\Program Files (x86)\Microsoft\Ilmerge\Ilmerge.exe" 
  /out:$(ProjectDir)bin\Debug\Merged.dll"$(ProjectDir)obj\Debug\Primary.dll"    
  "$(ProjectDir)bin\Debug\Secondary*.dll"

but it's throwing below error.

Error 1  The command ""C:\Program Files (x86)\Microsoft\Ilmerge\Ilmerge.exe" 
  /out:c:\users\user\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\bin\Debug\Merged.dll"c:\users\user\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\obj\Debug\Primary.dll"    
  "c:\users\user\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\bin\Debug\Secondary*.dll"" exited with code 3. IlmergeDllProject

and in the visual studio output window getting below message.

1>------ Build started: Project: IlmergeDllProject, Configuration: Debug Any CPU ------
1>  IlmergeDllProject -> c:\users\ansar.shaikh\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\bin\Debug\IlmergeDllProject.dll
1>  Usage: ilmerge [/lib:directory]* [/log[:filename]] [/keyfile:filename [/delaysign]] [/internalize[:filename]] [/t[arget]:(library|exe|winexe)] [/closed] [/ndebug] [/ver:version] [/copyattrs [/allowMultiple] [/keepFirst]] [/xmldocs] [/attr:filename] [/targetplatform:<version>[,<platformdir>] | /v1 | /v1.1 | /v2 | /v4] [/useFullPublicKeyForReferences] [/wildcards] [/zeroPeKind] [/allowDup:type]* [/union] [/align:n] /out:filename <primary assembly> [<other assemblies>...]
1>  The filename, directory name, or volume label syntax is incorrect.
1>  The system cannot find the path specified.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft\Ilmerge\Ilmerge.exe" 
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073:   /out:c:\users\ansar.shaikh\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\bin\Debug\Merged.dll"c:\users\user\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\obj\Debug\Primary.dll"    
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073:   "c:\users\user\documents\visual studio 2013\Projects\IlmergeDllProject\IlmergeDllProject\bin\Debug\Secondary*.dll"" exited with code 3.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

can anyone help me resolving this issue.

*This post is locked for comments

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Are you sure you have "$(ProjectDir)bin\Debug\Secondary*.dll" file?

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Try using a separate directory for merging in your bin/Debug. Usually that prevents files from being overwritten, and you can make it cleaner. Since we don't know your exact configuration, it's a little hard, but created a PreMerge directory under your bin\Debug, and you can do the following (in your Post-build event command line):

    move Primary.dll PreMerge

    move Secondary.dll PreMerge

    "$(SolutionDir)Tools\ILMerge.exe" /keyfile:"$(ProjectDir)Merged.snk" /out:"Merged.dll" "PreMerge\Primary.dll" "PreMerge\Secondary.dll" /log:"$(ProjectDir)errorlog.log" /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2"

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans