【问题标题】:Setting the Properties included in the app.manifest at compile time在编译时设置 app.manifest 中包含的属性
【发布时间】:2019-04-29 01:58:01
【问题描述】:

我的一个项目中有以下清单(在 C# 上的 Visual Studio 2013 上创建)。

<?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="5.4.0.5" name="Device"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"><security><requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"><requestedExecutionLevel level="highestAvailable" uiAccess="false" /></requestedPrivileges></security></trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application></application></compatibility>
</asmv1:assembly>

“assemblyIdentity”标签包含项目名称和版本;有没有办法用代码标记这个属性,以便在编译时从项目中获取两个值,而不是在文件上更改它?

【问题讨论】:

  • 使用构建后事件怎么样?
  • 必须存在 assemblyIdentity 元素才能使其成为有效的清单,操作系统需要它。然而,它在 C# 项目中没有任何作用,它只在使用 winsxs 的本机应用程序中很重要。托管代码始终使用 GAC。所以他们没有自动化它,也没有在构建时轻松更改,没有必要提供该功能。只需不改变它就可以取得成功。
  • 谢谢,如果是固定版本号,我会离开 - 我不知道如何使用 pre/pos 构建事件“Reniuz”

标签: c# visual-studio visual-studio-2013 manifest


【解决方案1】:

只是为了用我发现并解决我的需要的东西来结束它,MSDN's page 他们展示了如何指定构建事件 (C#) 并使用构建事件作为示例来更改应用程序清单。

【讨论】:

    猜你喜欢
    • 2019-01-28
    • 2014-09-08
    • 2011-06-29
    • 1970-01-01
    • 1970-01-01
    • 2015-08-15
    • 2020-11-30
    • 1970-01-01
    • 2020-06-12
    相关资源
    最近更新 更多