Visual Studio 2008 Generation of Designer File Failed (Cannot use a leading .. to exit above the top

Posted by tardomatic on Stack Overflow See other posts from Stack Overflow or by tardomatic
Published on 2009-07-22T10:34:31Z Indexed on 2010/06/01 19:43 UTC
Read the original article Hit count: 533

Hi,

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:

Generation of designer file failed: Cannot use a leading .. to exit above the top directory

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:


-------------------------------------------------------------
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)
-------------------------------------------------------------

And, of course this means that there is no way I can reference the newly added text box from the code behind.

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.

Any ideas out there?

Thanks in advance

Hamish

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about visual-studio