在我的一个项目中创建了以下清单(在Visual Studio 2013上,在C#上创建)。
<?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”标签包含项目名称和版本;有没有一种方法可以用代码标记此属性,以便在编译时从项目中获取两个值,而不是在文件上更改它们?