none
Getting error while running command in post build events.

    Question

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

    I am trying to merge the dll's.

    Friday, September 15, 2017 7:02 AM

Answers

  • Actually issue is resolved by removing the spaces from the path.

    as it was not taking that path correctly.

    • Marked as answer by EmpAnsar Monday, December 04, 2017 6:44 AM
    Monday, December 04, 2017 6:44 AM

All replies

  • Hi EmpAnsar,

    Thanks for posting here.

    >>>Getting error while running command in post build events.

    When you get the MSBuil error 3073 on the build event, it means the path is incorrect in your command. And the error log also show the reason for the failed command:

    1>  The filename, directory name, or volume label syntax is incorrect.
    1>  The system cannot find the path specified.

    So you should double check you command line in the build event.

    When I check you command, I found you are missing a double quotes in this path /out:$(ProjectDir)bin\Debug\Merged.dll. That because there is a blank space in the variable $(ProjectDir), you need add this path in double quotes. 

    Besides, a blank space is missing in the command "...Merged.dll"$(ProjectDir)...", so you need add it.

    The final command should be:

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

    Hope this helps.



    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, September 15, 2017 4:10 PM
  • @EmpAnsar, Any update for this issue? Have you resolve your question? If not, please let me know the latest status of this question.

    MSDN Community Support Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 25, 2017 5:18 AM
  • Actually issue is resolved by removing the spaces from the path.

    as it was not taking that path correctly.

    • Marked as answer by EmpAnsar Monday, December 04, 2017 6:44 AM
    Monday, December 04, 2017 6:44 AM