Is it necessary to change the assemblyIdentity's version attribute in a manifest file?

若如初见. 提交于 2019-12-09 14:20:07

问题


In the following manifest, is it necessary to change the version attribute of the assemblyIdentity element if the assembly version is specified in the project (or, in my case, set as part of a MSBuild task)?

According to this Microsoft Connect page, it looks like the project's version number overrides the manifest's version number. Please correct me if I'm wrong...

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" 
                xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" 
                xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="MyApp.exe" type="win32"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>

Help me Jon Skeet, you're my only hope... :)


回答1:


The point of the assembly information is to uniquely identify your application to Windows and it's components. This is similar to how .NET uses filename + version + ID generated + target processor arch to identify assemblies uniquely.

If you choose not to change it then Windows components may not see new versions of your application as uniquely different from old versions.

More information on the Application Manifests MSDN page.



来源:https://stackoverflow.com/questions/3365319/is-it-necessary-to-change-the-assemblyidentitys-version-attribute-in-a-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!