Search code examples
c#visual-studiovisual-studio-2013manifest

Setting the Properties included in the app.manifest at compile time


I have the following manifest in one project of mine (created on Visual Studio 2013, on 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>

The "assemblyIdentity" tag contains the project name and version; is there a way to mark this properties with a code to get both values from the project at compiler time, instead of changing it on the file?


Solution

  • Just to close this with something i found and solved my need, at MSDN's page they show how to Specify Build Events (C#) and use as an example a Build Event to change App Manifest.