Embedded manifest in .Net App

How to make someapp.exe.manifest file embedded in someapp.exe

In C++ application we could set manifest using manifest tool. I don't want to have separated from main application .manifest file. I've added manifest in C# project, but there is no special settings applied to manifest files in VS2005. The only option I've found useful is Copy to output directory -> copy if newer.



Answer this question

Embedded manifest in .Net App

  • BSohante

    I'm not sure what you mean. If you're talking about the Assembly manifest then that is embedded in all C# applications. You can't *not* embed it. You can access it using the System.Reflection namespace.
  • krollenhagen

    This is simply not true. In my experience the manifest is not embedded automatically. According to Microsoft tech support however:

    Yes, you can create embedded manifest for .NET applications but these are not created automatically. Here are some ways how you can create manifest using VS 2005 and one of its tools.

    ? Option #1 – Step-by-step approach

    Create a native resource script file (AppName.rc)

    #define RT_MANIFEST 24

    #define APP_MANIFEST 1

    APP_MANIFEST RT_MANIFEST AppName.exe.manifest

    Compile the resources using the resource compiler (rc.exe)

    rc.exe AppName.rc

    Embed the resources to the executable during build process

    ? csc /win32res:AppName.res AppName.cs

    ? vjc /win32res:AppName.res AppName.jsl

    ? vbc /win32resource:AppName.res AppName.vb

    ? Option #2 – Use mt.exe (any language)

    mt.exe -manifest AppName.exe.manifest –outputresource:AppName.exe;#1

    ? Option #3 – Specify the manifest file in the Project Properties (C++ only)


  • Embedded manifest in .Net App