tags:

views:

94

answers:

3

Hi ..

I want to ask about the files that are found in the folder of a simple C# Project . like (.pdb file , .vshost file , .manifest file ) in bin folder ( .csproj.fileListAbsolute.txt file , .pdb file ) in debug folder (AssemblyInfo.cs ) in Properties folder

what is the function of each file of them ?

and which of them is in MSIL , if there is no file of them in this language how can I get file in MSIL ?

another question : what is the specific part that converts C# code into MSIL ?? , Is it the C# Compiler ? Is there any specific name to it ?

+1  A: 

The executable (exe) or assembly (dll) will contain code in MSIL. The MSIL can be viewed using a tool like ILDASM or .NET Reflector. The C# compiler is csc.exe.

rtalbot
hummm .. I knew that exe (in General) include native code , it sounds in .Net is deferent ,then JIT compiler compile exe file to native code when it run , it's true ?
Farah_online
+6  A: 

Technically, the pdb, vshost, and manifest file are not part of a C# project, the are part of the output generated when you build the project.

The PDB file contains symbol information used by the debugger to associate code within the assembly with your sources files. This allows the debugger to identify which line of source code corresponds a set of instruction in the MSIL of an assembly.

The vshost.exe file is a hosting process that visual studio generates that helps accelerate the debugging of an application. It caches app domain for your process to reduce the startup time for the debugger.

The manifest file contains information about the assemblies in a project and some common metadata about them. Its contents varies by project type.

The csproj file is xml-based representation of the code and resources for a project. It's the file that Visual Studio uses to figure out what code and resuorces to compile into an assembly. This file also contains project settings and options that control how the compiler (and other tools) process the assets of a project.

None of these files contains MSIL. The MSIL is part of the .exe and .dll files generated when you build a project. These files are encoded using the Microsoft PE (portable executable) format, and contain resources, data, and MSIL code.

The exe and dll, and pdb files are generated by the C# compiler - csc.exe. The other files (IIRC) are generated by other tools invoked by the msbuild process that controls the entire build cycle.

LBushkin
thanks alot , your answer is exactly what I need :)
Farah_online
+1  A: 

Here's a quick list:

  • PDB - These are debugging symbols used by Visual Studio and other debuggers.
  • VSHOST - This is a special executable that's hosted by Visual Studio (hence the name) I think this is used to provide intellisense and debugging help (e.g. breakpoints).
  • MANIFEST - Depends on the kind of project you're working on. Usually this file lets you specify special OS-level needs for your application (e.g. UAC admin rights... security model etc. etc.)
  • CSPROJ - Think of this as a Makefile/Buildfrile for your application. (CSPROJ means a CSharp Project) - This file list all the files necessary to build your application and also any extra processing steps (like a Makefile target) that might be necessary.
  • AssemblyInfo.cs - This is just a normal C# code file, but usually reserved for adding assembly-level attributes. (a .NET assembly metadata, as opposed to a normal EXE file metadata which is used by the operating system)

MSIL is Microsoft Intermediate Language which is an intermediate representation of the code resulting from compiling C# source code (or other .NET languages) using the C# compiler (csc.exe).

The .NET Runtime then interprets or JIT-compile the IL into actual machine code when you run the application.

chakrit
thanks to your answer :)
Farah_online