Last post Aug 31, 2006 01:06 PM by Juan T. Llibre
Aug 31, 2006 01:47 AM|vikingbei|LINK
I had problem "Publish Web Site" function, compiled site got error when open in browser.
anyway, what I really want is just to compile the App_code only into DLLs.
I have 2 folders in App_code, BLL and DAL and they reference to each other
eg. in BLL classes they have using DAL, and in DAL classes they have using BLL
anyone can show me what's the best way of compile app_code into DLLs rather than compile the whole site which i didn't have good feeling about it.
Aug 31, 2006 02:43 AM|Jasson_King|LINK
With VS 2003 today you compile all code-behind into a single DLL, but ASP.NET will in turn derive new classes for each .aspx file and generate new assemblies dynamically at runtime.
The granularity of these assemblies is the same as the new compilation model in VS 2005 (roughly one per directory) -- so assuming you compile with full optimizations in VS 2005, you will have the same number of runtime assemblies loaded in your application
as you do with VS 2003.
Having said that, I would recommend against a directory structure containing 5,000 different directories each containing 1 .aspx page in it. That will be suboptimal for both VS 2003 and VS 2005 based solutions. ;-)
We are actually doing capacity measurements right now and are planning to publish some whitepapers this fall that go into more details regarding large app deployments (for example: how does perf perform when you have 1000s of master pages, or skins, or directories,
or pages, etc).
Hope this helps,
Aug 31, 2006 03:05 AM|vikingbei|LINK
Thanks Jasson for the inputs.
however what I want to know now is really just how to compile app_code into DLLs (even if it's in a manual way)
if you can provide some sample command line OR how it's get done in VS2005 would be great.
Aug 31, 2006 01:06 PM|Juan T. Llibre|LINK
Those are vb examples, using the Visual Basic compiler ( vbc.exe ),
but there no change, except the name of the compiler for c# ( csc.exe ).
Here's an example :
You'd compile the .cs file with a command-line like :
csc /t:library /out:..\bin\YourClass.dll YourClass.cs /r:system.dll /r:system.data.dll /r:system.xml.dll
If you call it it in your .aspx pages with a
<%@ Import Namespace="YourClassName" %>
directive, you can reference your methods with :
The only difference is that the DLL(s) would go in the /bin directory.