Why the same files are copied to /Approot and /Siteroot in Windows Azure WebRole?

来源:互联网 发布:淘宝同学课程助手 编辑:程序博客网 时间:2024/05/16 12:09

http://social.msdn.microsoft.com/Forums/is/windowsazuredevelopment/thread/8aa6666d-5b02-493e-9c6b-473355a9afad

There is a way to avoid that, but I would not use it. The reason for having 2 complete copies is the "Full IIS mode", which came out since Azure SDK 1.3. With full IIS mode there are two copies of you application, because:

1. The Full IIS allows you to have more than one site/virtual app in a single web role (pretty neat feature!).Thus there is the need for the "siteroot" folder, where all registered web applications are deployed

2. Your class that implements RoleEntryPoint runs under separate process - WaIISHost.exe, which is the requirement to have the full app sourcein approot.

From the other hand, when you fall back to old times, and decide to use just theHWC mode (Hostable Web Code), you willonly have the approot folder.But you will loose a lot of the IIS functionalities.

You can read more about the change from HWC to Full IIS at this blog post: http://blogs.msdn.com/b/windowsazure/archive/2010/12/02/new-full-iis-capabilities-differences-from-hosted-web-core.aspx

Going back to HWC mode (removing <sites>..</sites> section from your csdef) is the only way to avoid having code duplication.

Please note that this code duplication is *only* for the web roles you have, and only for the main web role application. If you have multiple sites defined,only the main web role will be duplicated. All other sites will be just in the siteroot folder.


原创粉丝点击