﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Precompiling the website for deployment</title><link>http://www.aspplayground.net/forum/</link><description /><copyright>(c) ASP Playground Support Forum</copyright><ttl>30</ttl><item><title>Precompiling the website for deployment (Samuel)</title><description>  &lt;h2&gt;Note: this article no longer applies for version 3.9 or later.&lt;/h2&gt; &amp;nbsp; &lt;br&gt;  If you'd like to precompile the forum for deployment, here is a trick you need to follow as you will run into a bug in Visual Studio's publish website feature. &lt;b&gt;  &lt;br&gt;   &lt;br&gt;  The compilation error only occurs some of the time&lt;/b&gt; and it is not a bug in the software.       &lt;br&gt;   &lt;br&gt;  The error will be something like the following:   &lt;br&gt;  &lt;i&gt;H:\forum\App_Templates\Classic\Regular.master(1): Build (web): Circular file references are not allowed&lt;/i&gt;.      &lt;br&gt;   &lt;br&gt;   &lt;br&gt;  &lt;h2&gt;Solution&lt;/h2&gt; First, please disable any AntiVirus software that is running on the machine. &lt;b&gt;Kaspersky &lt;/b&gt;for one is known to block compilation and it is best to disable it during the compilation process.  &lt;br&gt;  &amp;nbsp;  &lt;br&gt;  Second, simply &lt;b&gt;try compiling again&lt;/b&gt;, and the error will usually disappear.  &lt;br&gt;   &lt;br&gt;  If not, please follow the instruction:  &lt;br&gt;  &amp;nbsp;  &lt;br&gt;  Open &lt;b&gt;~/App_Templates/&lt;i&gt;Theme_Name&lt;/i&gt;/Regular.master&lt;/b&gt;  &lt;br&gt;   &lt;br&gt;  In the Master Directive, delete the MasterPageFile attribute so that it reads:   &lt;br&gt;  &lt;pre class="prettyprint"&gt;&amp;lt;%@ Master Language="VB" CodeFile="Regular.master.vb" Inherits="App_Masters_Classic_Regular" %&amp;gt;&lt;/pre&gt;   &lt;br&gt;  Then, when you publish the website, make sure you have "&lt;b&gt;Allow this precompiled site to be updatable&lt;/b&gt;" checked, as we will need to put the MasterPageFile attribute back in later.      &lt;br&gt;   &lt;br&gt;  [attachment=0]     &lt;br&gt;   &lt;br&gt;  Publish the site, and when it finishes,      &lt;br&gt;   &lt;br&gt;  Open &lt;b&gt;~/App_Templates/&lt;i&gt;Theme_Name&lt;/i&gt;/Regular.master&lt;/b&gt; in the Target Location (where you published the compiled site to)      &lt;br&gt;   &lt;br&gt;  You should see something like this in the first line:      &lt;br&gt;   &lt;br&gt;  &lt;pre class="prettyprint"&gt;&amp;lt;%@ master language="VB" inherits="App_Masters_Classic_Regular, App_Web__lnfy072" %&amp;gt;&lt;/pre&gt;      &lt;br&gt;   &lt;br&gt;  Put the MasterPageFile attribute back in, so that it reads:      &lt;br&gt;   &lt;br&gt;  &lt;pre class="prettyprint"&gt;&amp;lt;%@ master language="VB" inherits="App_Masters_Classic_Regular, App_Web__lnfy072" MasterPageFile="~/MasterPage.master" %&amp;gt;&lt;/pre&gt;      &lt;br&gt;   &lt;br&gt;  Do the above every time you compile the software, and it should work without any problem.      &lt;br&gt;   &lt;br&gt;  [attachment=1] &lt;br&gt;  </description><link>http://www.aspplayground.net/forum/fb.ashx?m=401542</link><pubDate>Wed, 22 Apr 2009 12:52:06 GMT</pubDate></item></channel></rss>
