Visual Studio post-build event macro of EditBin not working

176 Views Asked by At

I use Visual Studio Community 2022 64-bit Preview in Windows 11 64-bit. I write 32-bit application which imports 32-bit dll. I try to expand application-handling addresses over 2 gigabytes with /LARGEADDRESSAWARE option.

I tried the following post-build event macro but nothing happens.

"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.32919\bin\Hostx64\x64\editbin.exe" /LARGEADDRESSAWARE "$(TargetPath)"

Output window shows the message which seems that EditBin was executed without any error message.

Microsoft (R) COFF/PE Editor Version 14.38.32919.0

Running this in Developer PowerShell window works well.

PS C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.32919\bin\Hostx64\x64> editbin /LARGEADDRESSAWARE "C:\Users\shinj\Desktop\WinFormsApp1\WinFormsApp1\bin\x86\Debug\net7.0-windows\WinFormsApp1.exe"

Why does not the same syntax phrase work as the post-build event macro?

A weird thing is that the following macro specifies the TargetPath as WinFormsApp1.dll not exe.

editbin.exe /LARGEADDRESSAWARE "$(TargetPath)"

error MSB3073: The command "editbin.exe /LARGEADDRESSAWARE "C:\Users\shinj\Desktop\WinFormsApp1\WinFormsApp1\bin\x86\Debug\net7.0-windows\WinFormsApp1.dll"" exited with code 9009.

The Application > General > Output Type is set to Windows Application.

0

There are 0 best solutions below