SoFunction
Updated on 2025-03-07

Overview of the following file formats of the Bin directory during the development process.

In .NET development, we often see these types of files in the bin directory:

.pdb、.xsd、.、.exe、.、.

When the project is released, it is often difficult to figure out which ones are needed and which ones are not needed. So what are these format files used for?

pdb

.pdb file is a symbol file (program database) generated by VS, which saves debugging information. In VS's engineering properties, C/C++, debug information format, and setting/Zi, then VS will create a PDB file when building the project.

Here we need to distinguish two situations:

1. When building a static library, you can set the generated pdb file name in the project properties -> C/C++ -> Output File -> Program Database Name. If it is not specified, it is generated by default. Here x is the VS version number. For example, if you use VS2005, it will be generated. Here a question arises. The .pdb files generated by default when compiling static libraries are the same. Can the project that references this static library finally find the correct .pdb file? The answer is yes, because VS embeds the path to the .pdb file in the generated file.

For example, under Project/ToolA, a static library is built, and one is generated accordingly. Also, under Project/ToolB, a static library is built, and one is generated accordingly. Then the final project links these two static libraries at the same time. At this time, when generated, it will find its corresponding symbol file path Project/ToolA/ and its corresponding symbol file path Project/ToolB/ to merge to generate the final project.

2. Build an executable file or dynamic library. In this case, the compiler will generate a .pdb file, and the linker will generate a .pdb file. The pdb file generated by the compiler can be set in the project properties -> C/C++ -> Output file -> Program database name. The .pdb file generated by the linker can be set in the project properties -> Linker -> Debug -> Generate debug information (setting Yes), and generate program database name settings.

What is the difference between these two pdb files? The pdb file generated by the compiler is also named by vcx0 by default. It is stored in the symbolic information corresponding to each .obj file during the compilation process, but does not include function definitions. The .pdb file generated by the linker is named by the project name by default. It is a symbol file with complete information further processed by the linker when linking the project based on the compiler generated by the compiler. Just as the linker generates exe or dll based on each .obj file, the .pdb file generated by the compiler is an intermediate product of the compilation-linking process, and the last thing used to debug the program is generated by the linker.

The above is the pdb file generation rules. When using it, the debugging period will take the corresponding pdb file path of the file, and then go to the path (absolute path). If the exe or dll is compiled by itself, no matter where it is placed, the debugger can find the pdb file as long as it remains unmoved. If the debugger cannot be found in that path, it will search for the directory of the exe or dll at the same level. For example, this project was compiled by someone else and sent together with the symbol file. As long as we place the symbol file and the exe or dll in the same level directory, the debugger can find it. Of course, you can also specify the symbol file path yourself in the debugger

XSD

XSD refers to XML Schemas Definition

XML Schema is a replacement for DTD. XML Schema language is XSD.

XML Schema describes the structure of an XML document. A specified XML Schema can be used to verify an XML document to check whether the XML document meets its requirements. Document designers can use XML Schema to specify the structure and content allowed by an XML document, and can check whether an XML document is valid accordingly. XML Schema itself is an XML document that conforms to the XML syntax structure. It can be parsed with a general XML parser.

An XML Schema will define: elements that appear in the document, attributes that appear in the document, child elements, number of child elements, order of child elements, whether the element is empty, the data type of the element and attribute, the default and fixed value of the element or attribute.

The reason why XSD is a substitute for DTD is, first, it can be expanded according to future conditions, second, it is richer and more useful than DTD, third, it is written in XML, fourth, it supports data types, and fifth, it supports namespaces.

The suffix of the XSD file is .xsd.

Advantages of XML Schema:

1) XML Schema is based on XML and does not have a special syntax

2) XML can be parsed and processed like other XML files

3) XML Schema supports a series of data types (int, float, Boolean, date, etc.)

4) XML Schema provides an extensible data model.

5) XML Schema supports comprehensive namespace

6) XML Schema supports attribute groups.

. and .exe

.As the name suggests, it is a visual studio host application. When vs runs debugging, it is actually this file. This program allows vs to track debugging information. The host process is a feature in Visual Studio 2005/2008/2010/201x, which can improve debugging performance, support partial trust debugging and support design-time expression calculations.

The file name of the host process file contains vshost and is located in the project's output folder. Exe can be opened directly, vs will not track the running status of any of this file. As long as the referenced assembly is complete, it can be run directly.

The difference between . and .

.It is a non-debug configuration file.

It is a temporary file, used during debugging generated during debugging.

The contents of the files in the folder are exactly the same, mainly used for host process debugging and should not be directly run or deployed through the application.

The above is all the content of this article. I hope that the content of this article will help you study or work. I also hope to support me more!