How to install LARGEADRESSAWARE for ClickOnce application?

I struggled with this for a while. I have an application that uses a lot of mem and really benefits from using LargeAddressAware.

The problem in short: with the LAA flag, the application does not start.

Empirical Results:

1) I have a script release that runs the entire ClickOnce publication, then overwrites the executables and dll, then re-creates the manifest, signs it, etc.

2) Running the script gives me an application that installs and works beautifully

3) Adding this to post-build violates the application:

editbin /LARGEADDRESSAWARE <path>/obj/Publish/app.exe 

(yes, I know, we have an assembly configuration called Publish - idiotic - but it works ...)

The error message I get is:

Activating \ betabox \ appbeta \ app.application has thrown an exception. The following error messages were detected:

+ Strong name signature is not valid for this app.exe assembly.

Both my manifest and exe are signed with a valid code signing certificate. And the script works fine when the flag is not set.

I tried without my script, and also only the editbin command in post-assembly and publishing via VS - the same error.

So - is it impossible to publish an application with LARGEADRESSAWARE installed through ClickOnce?

Thanks!

+6
deployment clickonce
source share
1 answer

Solved!

Got help from Kira on ClickOnce forums: http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/b008087c-45f8-4de6-b8f5-f34fddb29c8c/?prof=required

Solution: The EXE must be re-signed with a new strong name after the LAA flag is set.

How to do it: In post-build, the flag is set:

 cd $(ProjectDir) editbin /LARGEADDRESSAWARE obj/$(ConfigurationName)/app.exe 

And after that, also in the post-build, the exe should be re-signed:

 sn -Ra obj\$(ConfigurationName)\app.exe PublicPrivateKeyFile.snk 

This, of course, assumes that PublicPrivateKeyFile.snk is the code signing key and is on its way to the Visual Studio project.

My problem was that I was rewriting all dlls / exes after the build using:

 for /R %BIN_DIR% %%f in (*.dll) do signtool sign /a /i "Thawte" /t http://timestamp.verisign.com/scripts/timstamp.dll "%%f" for /R %BIN_DIR% %%f in (*.exe) do signtool sign /a /i "Thawte" /t http://timestamp.verisign.com/scripts/timstamp.dll "%%f" 

But this does not update the strong name, just signs the exe as is.

Hope this helps someone!

+5
source share

All Articles