Home  >  Article  >  Backend Development  >  Overview of several file formats under the Bin directory during .net development process

Overview of several file formats under the Bin directory during .net development process

黄舟
黄舟Original
2016-12-13 13:06:571114browse

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. So what exactly are files in these formats used for?

pdb

.pdb file is a symbol file (program database), which stores debugging information. In the project properties of VS, C/C++, debug information format, set /Zi, then VS will create a PDB file when building the project.

Two situations need to be distinguished here:

1. When building a static library, you can use Project Properties –> C/C++ –> Output File –> Program Database Name Set the name of the generated pdb file. If not specified, it will be generated as VCx0.pdb by default, where x is the VS version number. For example, if you use VS2005, VC80.pdb will be generated. It will be born here I have a question. The names of the .pdb files generated by default when compiling a static library are all the same. Can the project that references this static library finally find the correct .pdb file? The answer is yes, because VS will embed it in the generated file The path to the .pdb file.

For example, under Project/ToolA, a static library ToolA.lib is built, corresponding to which a vc80.pdb is generated, also in Project Under /ToolB, a static library ToolB.lib is built, corresponding to which a vc80.pdb is generated. Then the final project Work.exe links these two static libraries at the same time. At this time, the When it becomes Work.pdb, its corresponding symbol file path Project/ToolA/vc80.pdb and ToolB.lib will be found in ToolA.lib. The corresponding symbol file path Project/ToolB/vc80.pdb is merged to generate Work.pdb of 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 found in the project properties –> C/C++ –> Output file –> Program database name setting, the .pdb file generated by the linker can be set in the project properties –> Linker –> Debugging –> Generate debugging information (set Yes), 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. During the compilation process, the compiler stores the symbol information corresponding to each .obj file in it, but does not include function definitions. The .pdb file generated by the linker is named by the project name by default. It is further processed by the linker based on the vcx0.pdb generated by the compiler when linking the project. Comes with complete information about the symbol file. Just like 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-link process and is finally used The debugger is ProjectName.pdb generated by the linker. The above mentioned are the pdb file generation rules. When using it, the pdb file path corresponding to the file will be obtained during debugging, and then go to that path (absolute path) to find it. If the exe or dll I compiled it myself, so no matter where it is placed, the debugger can find it as long as the pdb file does not move. If the debugger cannot find it in that path, it will search in the same level directory of the exe or dll. For example, this job The program was compiled by someone else and was sent along with the symbol file. As long as we put the symbol file in the same directory as the exe or dll, the debugger can also find it. Of course, you can also specify symbols yourself in the debugger File path

XSD

XSD refers to XML Schemas Definition

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

XML Schema describes the structure of an XML document. You can use a specified XML Schema to validate an XML document to check whether the XML document meets its requirements. Document designers can use XML Schema specifies the structure and content allowed by an XML document and can be used to check whether an XML document is valid. XML Schema itself is an XML document, which conforms to the XML syntax structure. It can be parsed with a common XML parser.

An XML Schema will define: elements that appear in the document, attributes that appear in the document, sub-elements, the number of sub-elements, the order of sub-elements, whether the elements are empty, the data types of elements and attributes, and the default and fixed values ​​of elements or attributes.

The reasons why XSD is a replacement for DTD are: first, it is extensible according to future conditions; second, it is richer and more useful than DTD; third, it is written in XML; fourth, it supports data types; fifth, it supports namespaces.

The suffix of XSD file is .xsd.

Advantages of XML Schema:

1) XML Schema is based on XML and has no 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.

.vshost.exe and .exe

.vshost.exe, as the name suggests, is a visual studio host application. When vs is running and debugging, it is actually this file that is opened. This program allows vs to track debugging information. The host process 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 file name of the host process file contains vshost and located in the project's output folder. The exe can be opened directly, and 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 .exe.config and .vshost.exe.config

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

vshost.exe.config is a temporary file that is generated during debugging and used for debugging.

The content of the vshost.exe.config file in the folder is exactly the same as .exe.config. It is mainly used for host process debugging and should not be run or deployed directly through the application.

The above is the entire content of this article. I hope the content of this article can bring some help to everyone’s study or work,


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Partial Class in ASP.NETNext article:Partial Class in ASP.NET