aspnet_compiler
aspnet_compiler 是一個把整個網站進行編譯的工具。
C:WINNTMicrosoft.NETFramework2.0.40607>aspnet_compiler -?
Utility to precompile an ASP.NET application
Copyright ( c ) Microsoft Corporation 2001-2003. All rights reserved.
Usage:
aspnet_compiler [-?] [-m metabasePath | -v virtualPath [-p physicalDir]]
[targetDir]
-? Prints this help text.
-m The full IIS metabase path of the application. This switch cannot
be combined with the -v or -p switches.
-v The virtual path of the application to be compiled (e.g.
"/MyApp"). If -p is specified, the physical path is used to locate
the application. Otherwise, the IIS metabase is used, and the
application is assumed to be in the default site (under
"/LM/W3SVC/1/Root"). This switch cannot be combined with the -m
switch.
-p The physical path of the application to be compiled. If -p is
missing, the IIS metabase is used to locate the app.
-nologo Suppress compiler copyright message.
targetDir The physical path to which the application is compiled. If not
specified, the application is precompiled in-place.
Examples:
The following two commands are equivalent, and rely on the IIS metabase. The
compiled application is deployed to c:MyTarget:
aspnet_compiler -m /LM/W3SVC/1/Root/MyApp c:MyTarget
aspnet_compiler -v /MyApp c:MyTarget
The following command compiles the application /MyApp in-place. The effect is
that no more compilations will be needed when HTTP requests are sent to it:
aspnet_compiler -v /MyApp
The following command does *not* rely on the IIS metabase, as it explicitly
specifies the physical source directory of the application:
aspnet_compiler -v /MyApp -p c:myapp c:MyTarget
Utility to precompile an ASP.NET application
Copyright ( c ) Microsoft Corporation 2001-2003. All rights reserved.
Usage:
aspnet_compiler [-?] [-m metabasePath | -v virtualPath [-p physicalDir]]
[targetDir]
-? Prints this help text.
-m The full IIS metabase path of the application. This switch cannot
be combined with the -v or -p switches.
-v The virtual path of the application to be compiled (e.g.
"/MyApp"). If -p is specified, the physical path is used to locate
the application. Otherwise, the IIS metabase is used, and the
application is assumed to be in the default site (under
"/LM/W3SVC/1/Root"). This switch cannot be combined with the -m
switch.
-p The physical path of the application to be compiled. If -p is
missing, the IIS metabase is used to locate the app.
-nologo Suppress compiler copyright message.
targetDir The physical path to which the application is compiled. If not
specified, the application is precompiled in-place.
Examples:
The following two commands are equivalent, and rely on the IIS metabase. The
compiled application is deployed to c:MyTarget:
aspnet_compiler -m /LM/W3SVC/1/Root/MyApp c:MyTarget
aspnet_compiler -v /MyApp c:MyTarget
The following command compiles the application /MyApp in-place. The effect is
that no more compilations will be needed when HTTP requests are sent to it:
aspnet_compiler -v /MyApp
The following command does *not* rely on the IIS metabase, as it explicitly
specifies the physical source directory of the application:
aspnet_compiler -v /MyApp -p c:myapp c:MyTarget
執行C:/WINNT/Microsoft.NET/Framework/v2.0.40607>aspnet_compiler -v /djlp1 -p H:/Websites/DljPortal c:/dljp1 之後,
在 c:/dljp1 生成了一個目錄,裡面有 bin 目錄,有data目錄,還有其他檔案都複製了過去了。
bin目錄下多了幾個dll檔案:__code7jyhe1in.dll __DljPortalltzbmqxr.dll __resources9y3reyon.dll default.aspx.cdcab7d2.compiled global.asax.compiled global.asax7xyenj3t.dll ...
而以前的 default.aspx 現在的內容變成:This is a marker file generated by the precompilation tool, and should not be deleted!
不過這個 c:/dljp1 是不會自動變成 http://localhost/dljp1 的。這還要自己去新增。
web.config 裡的資訊沒有變。 不過這次 codeSubDirectories/ 這個設定沒有提示錯誤了。。
最難得的是global.asax已經失蹤了,這個檔案將在bin目錄下用global.asax.compiled來指定。內容是:
<preserve resultType="3" virtualPath="/djlp1/global.asax" hash="fffffffac7751c8c"
filehash="ffffd6a40be55434" assembly="global.asaxx5e9jbd0" type="ASP.Global_asax">
<filedeps>
<filedep name="/djlp1/global.asax" />
</filedeps>
</preserve>
filehash="ffffd6a40be55434" assembly="global.asaxx5e9jbd0" type="ASP.Global_asax">
<filedeps>
<filedep name="/djlp1/global.asax" />
</filedeps>
</preserve>