Knowledge Base Article Number:
Q1545246
Question by:
Adam Cogan
Answered by:
David Klein Last
Updated:
17/02/2006 4:06:48 PM
Spot an error? Please
comment about this article
Question:
How do I precompile my ASP.NET 1.1 application? I don't want to go through every page to check for compile errors!
Answer:
ASP.NET 2.0 has precompilation built-in (when you compile through VS.NET 2005 or above) or with the command line aspnet_compiler.exe. However, if you are using ASP.NET 1.1, you can use this tip.
Place the following http handler section into your web.config:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="precompile.axd" type="System.Web.Handlers.BatchHandler"/>
</httpHandlers>
</system.web>
</configuration>
Then surf to the file http://webservername/VirtualDirectoryName/Precompile.axd
If your site has no errors, you will get a message "Batch Compilation Successful" displaying on the page. Otherwise, you will get an error from the pages on your site that do not precompile. Note that this will only work for the current directory. If you have subfolders, you will need to run it on the subfolders as well.
You may also have to restart you ASP.NET worker process (or just restart IIS) for the ASP.NET 1.1 precompiler to work.
Note: A more comprehensive way to find any error on any page is to:
- Add a Global Error Handler on your site as per (link to Exception Manager in the .NET Toolkit)
- Run Link Auditor to execute all pages (link to that)
- Then at the end of the scan look at the report
Keywords:
Hot Tip - ASP.NET
New Search
SSW Custom Support