Overview. Several file formats in the Bin directory during net development

  • 2021-08-31 07:41:06
  • OfStack

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

. pdb,. xsd,. vshost. exe,. exe,. exe. config,. vshost. exe. config

When a project is released, it is often unclear what is needed and what is not needed. So what are the files in these formats for?

pdb

The. pdb file, a symbol file generated by VS for debugging (ES24database), holds debugging information. In the engineering properties of VS, C/C + +, Debug Information Format, Sett/Zi, VS will create the PDB file when building the project.

There are two situations to distinguish here:

1. When building a static library, you can use the project properties > C/C + + > Output file > The program database name sets the generated pdb file name. If it is not specified, it is generated as VCx0. pdb by default. Here x is the version number of VS. For example, if VS2005 is used, VC80. pdb will be generated. There will be a question here. When compiling a static library, the name of the. pdb file generated by default is 1. Can the project referencing this static library finally find the correct. pdb file? The answer is yes, because VS embeds the path of the. pdb file in the generated file.

For example, under Project/ToolA, a static library ToolA.lib is constructed, which correspondingly generates an vc80. pdb. Also under Project/ToolB, a static library ToolB.lib is constructed, which correspondingly generates an vc80. pdb. Then the final project Work. exe links these two static libraries at the same time. At this time, when Work. pdb is generated, its corresponding symbol file path Project/ToolA/vc80. pdb and its corresponding symbol file path Project/ToolB/vc80. pdb will be found in ToolA. lib, and the final project Work. pdb will be merged.

2. Build an executable file or dynamic library. In this case, the compiler will generate 1. pdb file, and the linker will generate 1. pdb file. The pdb file generated by the compiler can be used in the project attribute > C/C + + > Output file > Program database name setting, linker generated. pdb file can be in the project properties > Linker > Debugging > Generate debugging information (set 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 with vcx0 by default, which stores the symbol information corresponding to each. obj file in the compiler during the compilation process, but does not include the function definition. The. pdb file generated by the linker is named by the project name by default, which is a symbol file with complete information processed by the linker according to vcx0. pdb generated by the compiler when linking the project. Just as the linker generates exe or dll1 from each. obj file, the. pdb file generated by the compiler is the intermediate product of the compile-link process, and the last one used to debug the program is the ProjectName. pdb generated by the linker.

The above is the pdb file generation rules. When in use, the tuning period will get the pdb file path corresponding to the file, and then go to that path (absolute path) to find it. If this exe or dll is compiled by yourself, no matter where it is placed, the debugger can find the pdb file as long as it does not move. If the debugger cannot find it in that path, it will look in the sibling directory of exe or dll. For example, this project was compiled by someone else, and it was sent together with the symbol file 1. We only need to put the symbol file in the same directory as exe or dll, and the debugger can find it. Of course, you can also specify the symbol file path yourself in the debugger

XSD

XSD refers to the XML structure definition (XML Schemas Definition)

XML Schema is a substitute for DTD. XML Schema language is also XSD.

XML Schema describes the structure of the XML document. You can validate an XML document with a specified XML Schema to check that the XML document meets its requirements. The document designer can specify the structure and content allowed for an XML document through XML Schema, and can check whether an XML document is valid accordingly. XML Schema itself is an XML document that conforms to the XML syntax. It can be parsed with the general purpose XML parser.

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

The reason why XSD is a replacement for DTD is that it is extensible according to future conditions, that it is richer and more useful than DTD, that it is written in XML, that it supports data types, and that it supports namespaces.

The XSD file has the suffix. xsd.

XML Schema Benefits:

1) XML Schema is based on XML and has no special syntax

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

3) XML Schema supports family 1 data types (int, float, Boolean, date, etc.)

4) XML Schema provides an extensible data model.

5) XML Schema supports integrated namespaces

6) XML Schema supports attribute groups.

. vshost. exe and.exe

. vshost. exe, as its name implies, is an visual studio host application. This file is actually opened when vs runs debugging. This program allows vs to track debugging information. Hosting processes is a feature in Visual Studio 2005/2008/2010/201x that improves debugging performance, supports partial trust debugging, and supports design-time expression evaluation.

The host process file contains vshost in its filename and is located in the project's output folder. While exe can be opened directly, vs does not track the operation of any of these files. As long as the referenced assembly is complete, it can be run directly.

Differences between. exe. config and. vshost. exe. config

. exe. config is a configuration file under non-debugging.

vshost. exe. config is a temporary file, generated in debug for debugging.

The contents of the vshost. exe. config file in the folder are identical to those of. exe. config, which are mainly used for host process debugging and should not be run or deployed directly through the application.


Related articles: