Search code examples
c#asp.netapp-code

Is the source code placed in the App_Code special folder in an ASP.NET Web Forms application as reliable as a compiled app?


I'm maintaining a legacy application that was written in Web Forms, and we have started bolting new functionality on to it that makes heavy use of API's. It's also written in VB .NET.

I've worked out that I can install the WebAPI nuget packages and set up routing in the Global.asax file. I've also worked out that I can put .cs files in the App_code directory and set up controllers etc (as I am far more productive with C#).

Does using the app_code directory make for a reliable application? I've read online that stuff in the App_Code directory gets compiled at runtime, so what does this? The installed version of .NET on the hosting server?

I recognise that mixing C# and VB Net in the same project, as well as Web Forms and Web API in the same project will make for a maintenance nightmare. I'm just using Web API because there is no equivalent Web Forms method that will let me produce API responses apart from using Web Handlers which are huge to write.


Solution

  • Yes, in that sense it's reliable; you can also precompile your App_Code code