Groups | Blog | Home
all groups > visual studio .net general > september 2007 >

visual studio .net general : Icon and version info missing after adding UAC manifest to C# .exe


Lars Ryssel
9/28/2007 6:16:00 AM
I'm trying to add a manifest to a C# .exe project.
My manifest looks like this:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<asmv2:trustInfo xmlns:asmv2="urn:schemas-microsoft-com:asm.v2">
<asmv2:security>
<asmv2:requestedPrivileges>
<asmv2:requestedExecutionLevel level="asInvoker" />
</asmv2:requestedPrivileges>
</asmv2:security>
</asmv2:trustInfo>
</assembly>

I add an .rc file and the manifest to my C# project and add a pre build step
that compiles the manifest.

I add the folowing section to my .csproj file.
<PropertyGroup>
<Win32Resource>Manifests\ManagedManifest.res</Win32Resource>
</PropertyGroup>

Everything seams to work as expected, and I get the manifest inside my .exe
file.

The problem is that my .exe now misses the icon and the version information
it had before.

I have seen several people suggesting to do it this way, including the
following:

http://channel9.msdn.com/Showpost.aspx?postid=211271
http://channel9.msdn.com/Screencasts/211271_Embedding%20a%20Manifest%20edited%20final_100k.wmv

http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx

Why does Visual Studio throw this information away and how is the correct
way to do it.
jetan NO[at]SPAM online.microsoft.com (
10/1/2007 12:00:00 AM
Hi,

It seems that you are using "Method #1 - The Step-By-Step Approach" in
Catherine Heller's blog. Yes, this is a known issue, Catherine has pointed
this out in this blog note below:
"[Updated on Feb. 16, 2007] Since writing this, I've learned of a couple of
issues that you should be aware of before deciding to use this approach:
assembly version information is lost after the binary native resources are
embedded into the executable, as are application icons. In the likely case
that you care about assembly version information and your application's
icon, use Method #2."
http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-
an-assembly-let-me-count-the-ways.aspx

So, you may try to use the Method #2 in his blog of using mt.exe. I assume
this will keep the assembly version information and application's icon.

Please feel free to give it a try and let me know if you need further help.
Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
jetan NO[at]SPAM online.microsoft.com (
10/4/2007 3:23:42 AM
Hi,

Have you reviewed my reply to you? Have you tried the method #2? Does it
work for you? If you still need any help or have any concern, please feel
free to tell me, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button