Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compilation of web.config file

I am reading the book Professional asp.net 2.0 published by Wrox, under the concept of asp.net compilation, chapter 3, page no. 98, they have written following lines:

Compilation process doesn't compile every type of web file. In fact, it compiles only the ASP.NET-specific file types & leaves out of the compilation process the following types of files:
- HTML files
- XML files
- XSD files
- web.config files
- text files

Then my question is that, what is the meaning of above lines?

  • is there really no need to compile web.config files?
  • if needs which compiler compiles these files (means .cs file compiled by c# compiler, .aspx file compiled by aspnet_compiler like this)
  • if it is not compiles, then how it gives compilation error when we make some mistakes in web.config file?
like image 836
Ravindra Bagale Avatar asked Jan 27 '26 15:01

Ravindra Bagale


2 Answers

The web.config is a configuration file and can not be compiled, it is just copied to the web site at deployment.

The file is parsed when the web application starts.

like image 181
Albin Sunnanbo Avatar answered Jan 30 '26 04:01

Albin Sunnanbo


All of the files above, are not compilable files. They are files that could be needed at runtime and thus, should be deployed with your project output.

In particular, web.config is the file that contains configuration for your website and it is loaded and interpreted by the ASP.NET runtime (and perhaps from your own compiled files)

HTML files are used to represent the contents of your website, XML files could be used as datastore for some kind of information and could be embedded inside your compiled files or required by your executables. TXT files, well, they are simple, human readable, files.

like image 29
Steve Avatar answered Jan 30 '26 05:01

Steve



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!