asp.net2.0程式的發布

來源:互聯網
上載者:User
這裡介紹兩種發布方式

1:使用開發工具中的CopySite功能。

      其實他還是一個XCopy,就是多了 同步檔案/串連網站 等功能。還是把所有原始碼一起發布了

2:使用先行編譯部署
      這一個就走向另外一個極端:發布的時候只有dll檔案,沒有任何原始碼,甚至是html代碼也沒有。

     使用方式:開啟asp.net2.0的sdk的Command Prompt或者找到windows/miscorsoft.net/framework/v2.0/目錄下,開始運行aspnet_compiler.exe。這個程式就可以進行先行編譯。aspnet_compiler.exe -?可以顯示出這個命令的協助。

    介紹一種格式:aspnet_compiler -v /<websitename> -p <source> <destination>

    比如:aspnet_compiler -v /form.ui.web -p c:\websites\form.ui.web c:\websites\deployment    該命令把虛擬目錄名字叫做form.ui.web位於c:\websites\form.ui.web 目錄下的程式先行編譯到c:\websites\deployment   目錄下。

編譯之後:

1:所有的.aspx頁面成了這種東西:

This is a marker file generated by the precompilation tool, and should not be deleted!

這個檔案的作用只是標記它存在,通過IIS可以訪問到,僅此而已,其內容已經全部被編譯到dll中,bin目錄下有一個default.aspx.cdcab7d2.compiled檔案存在

2:所有的ascx控制項“消失”了,同時在Bin裡面,多出來好多.compiled檔案,其中一個檔案內容如下:
    <preserve resultType="3" virtualPath="/form.ui.web/configFiles/IPS/InformationCreate.ascx" hash="bdca4e266" filehash="1879aaf63513" flags="10000" assembly="App_Web_x_lehwbd" type="ASP.InformationCreate_ascx">
    <filedeps>
        <filedep name="/form.ui.web/configFiles/IPS/InformationCreate.ascx" />
    </filedeps>
</preserve>

     也就是說在執行的時候,會根據這裡的聲明,從程式集裡面讀取這個檔案。

   一開始還擔心我裡面的調用ascx的代碼會出錯,因為我都是Control.Load(path); 萬一沒有了ascx檔案,豈不是Load不到了? 看來是杞人憂天了,沒有一點問題。

3:資源檔和以前差不多,被編譯到bin目錄下的若干個子目錄下,比如zn-ch什麼的。

4:global、masterpage和theme檔案也是類似的,出現了App_global.asax.compiled、default01.master.28fa1680.compiled、Theme_DefaultTheme.compiled等檔案

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.