473,382 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

C# and native resources

Problem: C# 2.0 doesn't imbed a UAC manifest in the EXE files that it
produces.
Problem: The suggested solution on MSDN is unworkable (manually opening the
EXE using VS as a resource editor and inserting the manifet resource).
Problem: Changing the C# project to explicitly link a .RES file suppresses
the generation of the native VS_VERSIONINFO resource by the C# compiler.

All in all, MS made it harder than necessary to produce a Vista-compliant
EXE from C# 2.0.

So how have people solved this problem?

It seems like some kind of command-line tool to insert the manifest resource
after the fact would be a good solution - there are a variety of such tools
on that market, all of which seem overpriced for such a simple task.

Any free tools out there that can insert a manifest resource into an
existing EXE?

-cd
Feb 13 '08 #1
4 2910
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:e4**************@TK2MSFTNGP02.phx.gbl...
Problem: C# 2.0 doesn't imbed a UAC manifest in the EXE files that it
produces.
Problem: The suggested solution on MSDN is unworkable (manually opening
the EXE using VS as a resource editor and inserting the manifet resource).
Problem: Changing the C# project to explicitly link a .RES file
suppresses the generation of the native VS_VERSIONINFO resource by the C#
compiler.

All in all, MS made it harder than necessary to produce a Vista-compliant
EXE from C# 2.0.

So how have people solved this problem?

It seems like some kind of command-line tool to insert the manifest
resource after the fact would be a good solution - there are a variety of
such tools on that market, all of which seem overpriced for such a simple
task.

Any free tools out there that can insert a manifest resource into an
existing EXE?

-cd


Carl, the Windows SDK comes with a tool called the "Microsoft (R) Manifest
Tool" the PE file is: mt.exe.

You can use this tool to embed a manifest in a post build step in VS2005.
VS2008 supports this by default, see the project settings.

Willy.
Feb 13 '08 #2
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message >
Carl, the Windows SDK comes with a tool called the "Microsoft (R) Manifest
Tool" the PE file is: mt.exe.

You can use this tool to embed a manifest in a post build step in VS2005.
VS2008 supports this by default, see the project settings.
OK, I wondered if mt.exe could do what I need. I'll take a look at the docs
for it. Glad to hear that they got this sorted out in VS2008 - it's a bit
of a pain in VS2005.

-cd
Feb 13 '08 #3
So far, nothing but disaster. I tried a different manifest fragment using
the v2 schema. That is acceptable to mt.exe, but the resulting EXE file
doesn't run, failing with "Configuration System Failed to Initialize".
That's after re-signing the EXE with sn.exe too.

Can anyone post a simple, complete example of embedding a manifest in a C#
exe file that's sufficient to let the app run 'asInvoker' on Vista?

-cd
Feb 13 '08 #4
Willy Denoyette [MVP] wrote:
Here's a KB article describing an alternate solution:
http://support.microsoft.com/kb/944276
Yeah, I'd found that one previously. Not a very automatable solution. I'll
stick with the post-build step. It does the job and it's all integrated
into my FinalBuilder-based product build.

-cd
Feb 15 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fred Mailhot | last post by:
Hi... Is there any way to do this for *nix ?? Pointers to resources and/or FAQS would be much appreciated. Thanks, Fred.
4
by: David Kantowitz | last post by:
I am trying to wrap a native-C++ DLL in managed C++, to use in a .NET project. The native code is compiled into a DLL, and I have created a .def file that exports the mangled names of the...
5
by: Dan | last post by:
Hi Gurus I got a very basic question to ask: When a .NET exe (MSIL) is first run, the JIT-compiler will converts the IL into native codes so that it can executes on the current machine. my...
3
by: main\(\){}; | last post by:
I can't ignore the speed of .NET managed applications in manipulating string, I/O and arithmetic operations. However, we can never compare the speed of a C/C++ program with its .NET counterpart...
1
by: dln | last post by:
Hey all. I'm a bit new to the language and I'm trying to figure out how to have my c# application interact with native code that is exported via a dll. I've run into a problem interfacing with a...
1
by: Samuel R. Neff | last post by:
We have a class that is a basic wrapper around a native 3rd party C DLL. We created an NUnit test against the wrapper and it passes fine the first time. However, when we run the tests again, it...
4
by: Tim Menninger | last post by:
Just started working on this and have not found any real good resources out there. We have a lot of native C++ Dll code that we use for our app. We want to share the code so that C# ASP.net code...
3
by: Amnon | last post by:
Hi, I'd like to announce release 1.0.7 of JNEXT (JavaScript Native Extensions). JNEXT is an open source framework for securely accessing the full range of native OS resources (files, databases,...
1
by: jc | last post by:
Hello. I'm doing some prep work before taking the vb.net brainbench. I noticed one of the topics is : Consuming resources - Windows Native Calls Where can I get more info on this? What...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.