如何在没有签名的ClickOnce应用程序的装配项目中设置LARGEADRESSAWARE? [英] How to set LARGEADRESSAWARE in no signing assembly projects for a ClickOnce app?

查看:71
本文介绍了如何在没有签名的ClickOnce应用程序的装配项目中设置LARGEADRESSAWARE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它具有以下两个后编译命令:

I have an application with the next two Post-Compilation commands:

call editbin /LARGEADDRESSAWARE $(TargetPath)
call editbin /LARGEADDRESSAWARE $(ProjectDir)obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName)

并可以正常工作。

但是当我发布到服务器时,ClickOne应用程序没有错误,但是尝试在客户端中安装时文件的哈希值与清单中计算的值不同。

But when I publish into a server as the ClickOne Application works with no errors but when I try install in a client the hash of file is different than the value calculated in the manifest.

我尝试使用下一条命令:

I tryed to use the next command:

sn -Ra $(ProjectDir)obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName) PublicPrivateKeyFile.snk

但不起作用,并显示下一条消息:

but does not work and it shows the next message:


app.exe并不代表任何强名称的程序集。

app.exe does not represent any strong-named assembly.

我想是因为我所有的项目都有对程序集签名 带有错误va的选项e。在使用LARGEADDRESSAWARE之前,ClickOnce应用程序可以正常工作。

I suppose it's because all my projects has the "signing the assembly" option with false value. Before using LARGEADDRESSAWARE the ClickOnce Application worked fine.

必须为所有项目设置具有真实值的签名程序集选项,否则可以使用LARGEADDRESSAWARE

It is necesary to set the "signing the assembly" option with true value for all projects or are there any way to use LARGEADDRESSAWARE with false value for this option?

编辑:

Mark Sowul的解决方案工作正常:
我还在AfterBuild的下一行中添加了代码,以检查AfterCompile是否正常工作

Solution of Mark Sowul works fine: Also I added in AfterBuild the next lines in order to check if the AfterCompile works fine

call "$(VS110COMNTOOLS)vsvars32.bat"
dumpbin /headers "$(TargetPath)" > "$(TargetPath).info"
findstr "(>2GB)" "$(TargetPath).info"
set BUID_ERRORLEVEL=%ERRORLEVEL%
del "$(TargetPath).info"
if [%BUID_ERRORLEVEL%]==[0] echo EXE program updated to use more than 2GB
if [%BUID_ERRORLEVEL%]==[1] echo ERROR: EXE PROGRAM WAS NOT UPDATED TO USE MORE THAN 2GB
set ERRORLEVEL=%BUID_ERRORLEVEL%


推荐答案

构建后事件在游戏中为时已晚。您像我一样在某种程度上发现了这一点,因为意识到您需要更改 obj 中的文件。

Post Build events are too late in the game. You have found this out to an extent, as I did, by realizing you need to alter the file in obj.

但是,构建后在清单生成后发生。因此,编辑obj文件为时已晚。最好的方法是在AfterCompile构建目标中。

However, Post Build occurs after the manifest generation. So editing the obj file there is too late. The better place to do it is in the AfterCompile build target.

您必须编辑csproj;在您已经看到的行之后添加:

You'll have to edit the csproj; add after the lines you'll already see for this:

<!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
    **<Target Name="AfterCompile">
        <Exec Command="
call &quot;$(VS110COMNTOOLS)\vsvars32.bat&quot;
editbin /largeaddressaware &quot;$(IntermediateOutputPath)$(TargetFileName)&quot;
" />
    </Target>**

这篇关于如何在没有签名的ClickOnce应用程序的装配项目中设置LARGEADRESSAWARE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆