Reputation: 11247
Does uploading an aspx page with only HTML content change to a web project will cause IIS to recompile the site?
Upvotes: 1
Views: 1193
Reputation: 2108
Yes, IIS will precompile the Website, even if the project is a Web Application, I say it because the Website is
compiled dynamically (automatically) by ASP.NET on the server the first time a request is received after the site has been installed or updated
and in the Web Application
You explicitly compile the source code on the computer that is used for development or source control
From Web Application Projects versus Web Site Projects in Visual Studio, MSDN
But even in the Web Application project, web pages (.aspx), user controls (.ascx), and MVC Razor views (.cshtml and .vbhtml) are compiled dynamically on the server by the ASP.NET compiler.
Now, answering your question, yes, it will compile because it is a .aspx file, and the .aspx files (and another file types like .ascx, .ashx, etc) are considered even if it only has HTML inside,
When the first request is made to an application, ASP.NET compiles files in a specific order. The first items to be compiled are referred to as the top-level items. After the first request, the top-level items are recompiled only if a dependency changes.
Top-level items include the App_GlobalResources folder, the App_WebResources folder, profile properties, the App_Code folder, and the Global.asax file. After the top-level items are compiled, ASP.NET compiles additional items.
These items include the App_LocalResources folder, individual ASP.NET pages (.aspx files), ASP.NET user controls (.ascx files), ASP.NET HTTP Handlers (.ashx files), and ASP.NET HTTP modules (.asmx files), as well as themes, master pages, and other source files.
From Understanding ASP.NET Dynamic Compilation
Upvotes: 1
Reputation: 11222
Even when you upload an ASPX file that does have code content like <script runat="server">
IIS will not recompile the site. Compilation will happen the first time someone hits that page.
But even if you do not have any server site code on the page, the C# or VB.Net compiler will fire up. It doesn't know that there is no code in there yet.
But as far as I know it will normally only compile the new page, not the whole site.
Upvotes: 1