473,761 Members | 8,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2928
"Carl Daniel [VC++ MVP]" <cp************ *************** **@mvps.org.nos pam>
wrote in message news:e4******** ******@TK2MSFTN GP02.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.bewro te 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 "Configurat ion 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
1865
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
4127
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 symbols I am going to use from the wrapper library. The wrapper library has the code written that uses the native classes, and wraps them to present an equivalent of their interface for .NET.
5
5314
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 question is: 1) where does the native codes reside? is it saved somewhere in the hard drive or it will only resides in the memory? or does the JIT compiler writes
3
1676
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 when it comes to some heavy operations, like long loops, graphics, load time and many other issues. The dream is; having an intermediate language (IL) run in the virtual machine at the speed of an unmanaged code. Java has in many ways solved this...
1
2066
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 native dll method where one or more of the parameters in the native routine is an array or pointer to block of contiguous memory. So, for example, the method as exported from the native Dll is declared as: extern "C" unsigned int __stdcall...
1
1927
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 always fails with a NullReferenceException within the native DLL (or on the call to it, not sure which). Since NUnit works by creating a new AppDomain each time it runs a series of tests, it seems weird that the native DLL appears to be
4
9877
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 can use the same business logic as our C++ client. Here are some questions: 1) Is there a way to call into native C++ classes directly? Meaning we do not have C API. I believe we could use a C API using the in C#. 2) If can't do #1, do we need...
3
2101
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, sockets etc.) by using JavaScript from within a Web Page. It is light weight, cross platform, cross browser and designed with simplicity in mind. More information is available at http://jnext.org
1
1401
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 exactly is a Windows Native call? Controls that talk to the OS?
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7332
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.