Do we need to deploy code behind files while working with ASP.NET 2.0 ?

 

Whidbey introduce many new features for web programmers but also change the way ASPX files are handle. There is no more "bin" directory where code behind classes compiled into DLL. All web application files including ASPX files and code behind files eventually exists as IL code under application directory in "Temporary ASP.NET files". There are no way to build the application due to the fact that all web application files compile by ASP.NET the first time the WEB application called. while this ability let us build WEB applications where every page can be build with other programming language there is something that bother me.

 

If all pages compile on demand and I'm creating new page with code behind file, I need to deploy both ASPX and code behind files to the server. Yes it nice to change *.cs file on the server and to see the results when calling the page but is it right to put source file on the server?

                                                                                                        

5 Comments

  • You can compile everything into a single DLL and put that on your server. In that case you wouldn't need to put the source files on the server afaik.



    By the way, you can also just open precompile.axd (or something like that) to precompile all pages at once, so not every page is compiled upon its first request.

  • That the point, you cant compile your application with whidbey to one single DLL. I'll be happy if you can show me how do it ...



    there isnt any bin directory and all the files eventually compiled into one ore more dlls but just by asp.net.



    by the way how several pages writing in diffrent development languages can be compile to single DLL?

  • The problem that remains (so far to my knowledge) is that you can no longer deploy your html source while pre-compiling your code-behind. This will mean that the ability to easily alter your content on the fly will require that you deploy your source code, unlike today!

  • Paul,



    I'm not so sure about that. As far as I can tell, Whidbey still supports the Inherits attribute of the @Page declaration, so there should be no reason why you couldn't write code-behind classes as in v1.1, compile them using the command-line compiler, and deploy just the .aspx files and the compiled assembly.



    I haven't played around with this deployment scenario, so perhaps I'm missing something, but I don't think that support for the \bin directory has been removed.

  • Andrew Hi,



    And if my application is build from pages writing in several languages I'll get DLL for every language?



    Still if I don't use pre compilation ASP.NET convert ASPX file into *.cs / *.vb file or files and compiled them, when application called in the first time. So I can change source file or ASPX file and I'll see those changes once I browse that page. I agree that its a benefit but if that option is the default one many programmers will use it and I'm not sure its good approach.



    I also thinking that changing the previous method of processing page (that ends up with two classes, each one of them on different assembly) to one class in single DLL is also a benefit.



    Actually I'm writing an article that deals with the way ASP.NET handle ASPX files. I'll be happy if can review it.



    Thanks



    natty

Comments have been disabled for this content.