title: Visual Studio 2008 Generation of Designer File Failed (Cannot use a leading .. to exit above the top directory)
body: <p>It seems the universe is against me this week. I have been happily coding away on my ASP.Net application for weeks now without issues. Today I tried to add a textbox to a form, and on saving the form, I received the following error:</p>
  
  <pre>Generation of designer file failed: Cannot use a leading .. to exit above the top directory</pre>
  
  <p>I googled, but with no luck. I did find a blog post that shows how to add a key into the registry so that Visual Studio logs more detail about these errors, and the following is what shows up in the generated log file:</p>
  
  <pre>
  
  -------------------------------------------------------------
  C:\[path to aspx file]\PageName.aspx
  Generation of designer file failed: Cannot use a leading .. to exit above the top directory.
  -------------------------------------------------------------
  System.Web.HttpException: Cannot use a leading .. to exit above the top directory.
     at System.Web.Util.UrlPath.ReduceVirtualPath(String path)
     at System.Web.Util.UrlPath.Reduce(String path)
     at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
     at System.Web.VirtualPath.Combine(VirtualPath relativePath)
     at System.Web.VirtualPath.Combine(VirtualPath v1, VirtualPath v2)
     at System.Web.VirtualPathUtility.Combine(String basePath, String relativePath)
     at Microsoft.VisualStudio.Web.Application.Parser.BeginParse(String virtualPath, String text)
     at Microsoft.VisualStudio.Web.Application.Generator.UpdateDesignerClass(String document, String codeBehind, String codeBehindFile, String[] publicFields, UDC_Flags flags)
  -------------------------------------------------------------</pre>
  
  <p>And, of course this means that there is no way I can reference the newly added text box from the code behind. </p>
  
  <p>I thought it might be just this page giving the issue, but I have tried three other pages with the same result. I haven't changed the environment for weeks, so I am not sure how this happens.</p>
  
  <p>Any ideas out there?</p>
  
  <p>Thanks in advance</p>
  
  <p>Hamish</p>