Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - do I need manifest files?

Tags:

I am curious whether I need two manifest files that are created when I publish my application. It works when I delete them. In the case they are needed, I have tried to embed (Project>Application>Embed manifest with default setting) them but they are still external.

Those are: (appname).exe.manifest and (appname).application.

like image 826
Mirek Avatar asked Nov 29 '09 10:11

Mirek


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.

What is C language basics?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.


2 Answers

The manifest file describes how your application should run. From MSDN:

Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information.

So deleting them is probably the wrong thing to do, especially if you want your application to run elevated by default on Vista and beyond.

Here are details from MSDN on use of the mt tool, which is used to embed the manifest in your application.

Also note a really interesting issue concerning the caching of the manifest in Vista and beyond that looks like a real gotcha.

like image 171
Jeremy McGee Avatar answered Sep 30 '22 05:09

Jeremy McGee


Also, Back when VS2003 was used, and you want to make your controls look more like the XP interface, the manifest will contain the common controls with the appropriate version 6.x which is used along with your application, then the GUI gets a "nice updated look and feel of XP" instead of the old clunky windows 2000 controls. For that reason, you can have the manifest embedded as a resource so you do not have to lug around a manifest file (ok, it is a quite small file) but nonetheless, it makes the application distribution neater.

And also, there was a bug in the .NET 1.1 runtime (now fixed in 2.0+) where if a manifest is used at your application fails to update the GUI to give it more of an XP look and feel. The workaround at the time was to call Application.DoEvents before doing an Application.Run(new form());

Now, with Vista and Win 7, the manifest is used to specify elevated permissions to get around the UAC thereby minimizing the chance of Vista/Win 7 having to pop up an UAC dialog box.

like image 37
t0mm13b Avatar answered Sep 30 '22 04:09

t0mm13b