Hello all!
This is my first blog's post, I am thrilled to start writing my thoughts, and I have a lot of them (I think....).
In my first post, I will go into details of 'Publish website in .NET 2.0', this issue is different and renewed then .NET 1.1 - there are several new issues that someone that is not familiar with .NET 2.0 will be glad to hear, so lets start...
As known, publishing web application under visual studio 2005 platform is different than publishing the same application under visual studio 2003 platform.
In VS 2003, when we had wanted to deploy a site (web application) to production area, we had need go to the Project tab and select the Copy Project option, this action had gathered all the web site execution's necessery files and copied it to a new folder.
In VS 2005, we got some innovations that gives us several alternatives to deploy web site to production area. The main action to deploy a web application to deployment is Publish, to do this you need to mark the web site project, press the right button and choose Publish Web Site. When you do this action, the application will be precompiled and it will be saved in the specified folder that you noted.
Other actions that you can determine while doing the publish action are:
- Allowing the precompiled web site to be updatable - by marking this checkbox, all the ASPX files with their markup intact as well, will be precompiled into a single DLL (under the /bin folder), that represents it.
- Using fixed naming and single page assemblies - choosing this action and the former one, will create a single DLL file to each ASPX file.
- Enabling string naming on precompiled assemblies - by choosing this option, you will need to give strong name to the generated assembly(ies), this name (key) will deffer it from newer same name assemblies that precompiled with no strong name or without any.
- Lastly, if you will publish the web site with none of the checkboxes selected, a single DLL will be created with no markup of the ASPX files and compiled metadata files for each ASPX file.
These actions will be pointed to the aspnet_compiler tool. This tool, supplies a creation of debugging symbols, but this action will not be able to happen from publish action, because if supplies precompilation in release state without symbols. (You can read more about aspnet_compiler here: http://odetocode.com/Articles/417.aspx).
In order to attach symbols to to web application, there is new tool named: Web Site Deployment (WSD). You can download it from this address: http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx. This tool adds several compilations configurations in release and degub mode.
In a nutshell, the steps of adding symbols by this tool are:
- Mark the web site application, right click on you mouse and choose the Add Web Deployment Project option.
- Select the name and the location of the web site to deploy.
- Now, a deployed project had been added to you solution! Mark it and by right clicking, select the Property pages option.
- Mark Generate debug information and finish.
- Build the whole application.
After these actions, a new folder with the given name by you will be created, and symbols will be 'stuck' to the application. (Real life example is: In the production server, you can see the souce code line while a runtime error will happen, good thing right...?)
Related links are:
http://download.microsoft.com/download/1/5/4/1541980a-d8fc-407b-8c9f-c2df5445b041/Using%20web_deployment_projects_final.doc
Good article about this post: http://odetocode.com/Blogs/scott/archive/2005/11/15/2464.aspx
That's it for now. I will be glad to hear your comment about this (this is my first one, don't forget).
See you here...