ASP.NET Website vs ASP.NET Web Application project
Web Application Projects in Microsoft Visual Studio
Microsoft Visual Studio provides two options for creating web applications: one is the ASP.NET website project and the other is ASP.NET Web application project. Way back in 2013 or maybe even long before that, Microsoft has been recommending use of ASP.NET Web application project for web applications. The use of ASP.NET Website template has been discouraged because it has a lot of issues which we will discuss below.
ASP.NET website project
ASP.NET web application project
How to find out if you have an ASP.NET Website or an ASP.NET Web application project?
Go to your IIS Server manager console, and locate the web application you are interested in. Right click it in the connections tree and click on Explore button. This will take you to the folder where the web application binaries are saved. If the folder has a directory called "bin" and it has a lot of files that have similar names except for a weird-looking IDs appended to them (e.g. MyPageOne_abcdefghi.dll; MyPageOne_jklmnopqr.dll and so on), you have an ASP.NET website rather than ASP.NET Web application.
Although one can compile their entire site into a single .dll for their ASP.NET Website, people do not seem to do that somehow and what is created is a complete mess.
领英推荐
The main trouble with an ASP.NET website is that due to the default large number of .dll files for each page and with so many of such pages, it becomes prone to security risks, slow load time and next-to-impossible debugging.
On the other hand, an ASP.NET web application is more secure, loads faster (with the same code and number of .aspx pages as used in the similar ASP.NET website) and are easy to debug.
Choice is yours.
References
Web Application Projects versus Web Site Projects in Visual Studio | Microsoft Docs This article itself is very old (2013) and Microsoft is not updating that page regularly. However, the information in that page still holds true.
Principal Consultant at Code Guru Too, Inc.
1 年Great article. Thank you!
Software Engineer | .NET | Clean Code
1 年Very informative article. Thanks!
Technology Disclaimer: My views expressed here on LinkedIn are my own and they do not represent anyone else.
3 年There are many who have developed ASP.NET Websites in the name of Web applications. Using an ASP.NET website template for adding a little dynamism (using C#/VB.NET code) in "App_Code" folder helps quickly build up some interactivity in a website. However, doing this in a huge/enterprise web applications is entirely wrong and is an anti-pattern. Such web applications developed with ASP.NET website template tend to be messy, unmanageable, buggy, difficult to debug and extremely low-performance. Developers who have supported such an anti-pattern have not understood what a web application is and what web application performance is.