Skip to content

Run ILRepack in the output directory with relative input paths - #190

Open
djack42 wants to merge 1 commit into
microsoft:mainfrom
djack42:upstream-pr/ilrepack-relative-paths
Open

djack42 wants to merge 1 commit into
microsoft:mainfrom
djack42:upstream-pr/ilrepack-relative-paths

Conversation

@djack42

@djack42 djack42 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

In Release, ILRepacker passes every input assembly to ILRepack with its full path: about 90 to 120 assemblies for the net472 plugins. Exec runs the command through a temporary batch file, and the command line gets long: 11,082 characters for src/Local (net472) from a 47-character repository path.

On a Windows Server 2016 build agent, a 9,383-character command lost a character in the middle: ILRepack failed with Input file not found: ...\System.Security.Cryptography.ProectedData.dll (note "Proected"). That matches cmd.exe's 8,191-character limit for lines in batch files. The same kind of command runs fine on Windows 11 here, so the failure depends on the Windows version and on the repository path.

This change runs ILRepack with WorkingDirectory set to the output directory, and passes the input assemblies by file name, since they all come from $(OutputPath)*.dll. The key file path is made absolute, since it was relative to the project directory. The /out and /lib arguments are unchanged. The command for src/Local (net472) drops from 11,082 to 3,270 characters, well under the limit on any Windows version.

🤖 Generated with Claude Code

With full paths, the ILRepack command line of the net472 plugins (about 100
input assemblies) gets over 11,000 characters. Exec runs it through a batch
file, and on Windows Server 2016 a character was dropped from a 9,383-character
command (cmd.exe's 8,191-character limit for batch file lines), so ILRepack
failed with "Input file not found". Passing the inputs by file name from the
output directory keeps the command around 3,300 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant