开发者

Precompilation for Deployment

After exploring Precompilation for Deployment topic I want to enhance my build process. Now, what I do is:

  • prepare web site using Web One Click Publish, for instance to c:\www\app directory, and that directory is available in IIS via app (localhost/app)
  • I launch aspnet_compiler.exe -v app c:\www\appprecompiled -f

Now I have ready precompiled application in c:\www\appprecompiled and everything is fine. However my application is quite big, and Publishing it (step 1) take about 5 minutes from scratch. So I wonder if it is possible to avoid step one , and perform step 2 (precompilation) with source folder pointing to solution folder. I tried something like this:

aspnet_compiler.exe -v codeapp c:\code\app -f

Where c:\code\app is the folder with web.config etc files, basically it's a project with web site and that folder is avaliable via http://localhost/codeapp.

But when launching that command, I get errors about missing global.asax or web.config errors:

C:\code\app\obj\debug\package\packagetmp\web.config(18): error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

And for the record, I开发者_运维问答 use Application, not Virtual Directory.

So is there a way to perform precompilation on a plain web site folder?


I used

aspnet_compiler -p physicalOrRelativePath -v / targetPath

from http://msdn.microsoft.com/en-us/library/ms227976(v=VS.80).aspx and removed obj folder prior to executing it, and precompilation works :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜