NIGHTMARE (Night of the Living Dead - WAP conversion): Endless Loop of Reference/Reciprocal errors (Impossible Puzzle to Solve?)
<p>Please read this carefully in its entirety and think about it before replying.  It might be a simple fix but I highly doubt it.  You have to understand the scenario here and conflicts I'm explaining fully to be able to help me.</p>

<p>So I have copied over our web site code to a WAP project.  I got rid of any reference errors.  Believe me I've checked every single error.  Now here comes my problem and hypothesis (it can't be solved):</p>

<p>We have a master page which has a bunch of public properties in it.</p>

<p>Almost all our .aspx.cs code is referencing some sort of property from Master and using it.</p>

<p>However, on the flip side, our master page cannot recognize any of my user or custom control tags that I've registered in the Master page.  The register tags are fine.  These were all referencing just fine together in a Web Site Project (both the master page was referencing its references to some user and custom controls and any .aspx.cs was referencing any master page public properties jsut fine).</p>

<p>So, if you think about this, this could be an endless loop that can never get resolved in this WAP conversion.  Why?  Because the way I see it, if my Master page can't reference the few user controls or custom controls in it, my master page will not compile.  If the reason that my master page cannot compile and reference these user and custom controls is because there are "other errors" and those other errors being that .aspx.cs files error out because they get errors referncing the master page public properties then we have a real problem.  It's like both are erroring out because both relate to each other and have problems that cannot get resolve because they're related!  Do you catch my drift?</p>

<p>Let me give an example / analogy to put this into perspective.</p>

<p><strong>MyMasterPage.aspx</strong></p>

<p>(example code in it)</p>

<pre><code>&lt;%@ Register Src="~/WebControls/User/Navbar.ascx" TagName="Navbar" TagPrefix="ac" %&gt;

&lt;%@ Register TagPrefix="am" Namespace="[ourglobalnamespace].Controls.Custom" %&gt;

&lt;tr&gt;
    &lt;td valign=top runat="server" id="tdNavBar"&gt;&lt;ac:Navbar runat="server" id="navbar"&gt;&lt;/ac:Navbar&gt;&lt;/td&gt; (this references a user control and is blowing up)
&lt;/tr&gt;

...

&lt;tr&gt;
        &lt;td&gt;&lt;am:NavigationPath runat="server" id="navPath" Seperator="&amp;raquo;" /&gt;&lt;/td&gt; (this references a custom control and is blowing up)
    &lt;/tr&gt;
</code></pre>

<p>Right now I get errors saying it doesn't recognize either of the controls above for whatever reason I cannot understand</p>

<p><strong>MyMasterPage.aspx.cs</strong></p>

<pre><code>   public BL.Store Store  
   {  
      get { return this.store; }  
   }  

   public BL.Product Product  
   {  
      get { return this.product; }  
   }
</code></pre>

<p>just showing some public properties we're exposing through the Master Page's code behind. These properties are referenced and used in .aspx.cs code behind classes throughout our code.</p>

<p><strong>Example .aspx .cs using the Master Page Properties:</strong></p>

<pre><code>   protected override void OnInit(EventArgs e)  
   {  
      int productID = Master.ProductID;  
      product = Master.Product;  

        protected override void OnInit(EventArgs e)
        {
            int productID = Master.ProductID;
            product = Master.Product;
         ...
</code></pre>

<p><strong>So imagine I now have 1500+ errors mainly due to 2 reasons and they are not becuase of reference errors (I fixed all that):</strong></p>

<p><strong>1)</strong> Master Page cannot compile</p>

<p><strong>2)</strong> Code-behind for .aspx pages blow up because Master page cannot compile therefore any references to Master Page properties cause the code behind to blow up</p>

<p>how the hell would I be able to resolve this if both errors practically rely on each other to be fixed?  It's impossible!</p>

<p><strong>3)</strong> Designer files cannot be generated for those remaining files that have these problems.  So I am not able to right click the Master Page and those user controls in order to convert to web application so that it will successfully create the .designer.cs files for them</p>

<p>so we really have 3 problems (3rd being an after effect fo 1&amp;2) that I have no idea how to resolve here all stemming from the Master page blowing up but could be blowing up because the code-behind pages are blowing up that reference the properties of the master page that is also blowing up!  Do you catch my drift?</p>

<p>I hope it's something stupid simple that I've overlooked but I've spent a couple days on this and I see nothing else that will allow me to resolve this mess.</p>

<p>Someone shoot me to get rid of this conversion pain.  If anyone can help me resolve this I swear I will send you a fing case of Beer!</p>
