![]() ![]() If you add a App_Code folder into a Web Application Project and add classes to that folder then more than likely their “Build Action” will be marked as “Compile” (as all. You will notice that App_Code folder is not really available as an option… This is an intentional behavior… With this understanding let us look at right click Add-> Add ASP.NET Folder -> options on Web Application Project WebApplication1.dll, being created in the BIN folder of your project… In case of WAPs every file in the project is marked with a specific “Build Action” as shown below:Īll the class files (.vb/.cs) are marked as “Compile”… This essentially tells VS to take all those files and call the correct VB/C# compilers on them… The result of that activity is the DLL,which is named same as your project name i.e. This essentially allows you to drop random class/code files in this folder to be compiled on the server side… For this very reason if you drop something new into the App_Code folder of your running web site, it is like resetting it coz ASP.NET runtime now recognizes that there is a new class which needs to be kept in consideration during running the site… This magical folder brings with itself various connotations when it comes to different project types…įirst of all it is important to know that Visual Studio does not really create any DLLs when you are using Web Site Projects (even when you are building the web site)… VS simply validates that your code is correct in WSP… In Web Application Projects (WAPs) this is not actually true as VS actually creates a DLL with all the code behind and class files that are present in your project and drops them into the BIN folder of your project… While this is true for Web Site Projects (WSPs), it is not so much true for Web Application Projects (WAPs) and in this post I will try to explain the inner workings on why that is the case…įirstly App_Code folder is a special ASP.NET RUNTIME folder… Any files in this folder are compiled by ASP.NET when your site is actually running on the server. Often time developers hear that if you want to put a random class file in your web project you should put it in App_Code folder. ![]() As you might already know we have two different project types for web development in Visual Studio 1.) Web Application Projects (WAPs) 2.) Web Site Projects (WSPs)…
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |