Publish app removes LargeAdressAware
We are publishing with command dotnet publish "path" --no-restore --no-build --no-self-contained After publishing the LargeAdressAware disappears. As a workaround I am thinking about copying my *.exe from Release to Publish folder. It looks like impossible to use the package with publish command.
Try using https://msbuildlog.com and pass -bl to your dotnet publish and then inspect the binlog to understand what's happening. You can search for the exe name and see which targets copy it or rewrite it.
For your .exe, what is the TargetFramework? What is the PlatformTarget? Does it have to be 32-bit? When you run corflags my.exe, what does it print?
Thanks for your time. It looks like dotnet publish "path" --bl doesn't produce any logs while with dotnet build it works.
coflags doesn't work well on mychine but I used dotPeek to check headers:
Just after build:
After publishing with --no-build option:
The flag disappeared. The same happens in Pipeline when we are about to create installer and doing publishing after build.
I also tried "AfterPublish" instead of "AfterBuild" and it didn't help
what's in your .csproj file? are you setting PlatfromTarget x86?
Try setting PlatfromTarget AnyCpu and then set Prefer32Bit to true in .csproj. Then you get 4GB of address space and you don't need LargeAddressAware at all.
you can also use dumpbin /headers on your binary. Strange that corflags doesn't work
also you should use -bl not --bl
focus on getting the binlog from publish, then you will know who overwrites your exe and why
what is the exact file size of your exe?
Thanks Kirill,
Logs helped me to understand that Publish for WPF copies intermediate assembly obj/apphost.exe instead of Release/appname.exe.