Search

VirtualPathProvider hides compilation errors by ZanoChat

Closed
as Fixed Help for as Fixed

1
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 307978
Opened: 11/1/2007 6:05:16 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
When using a System.Web.Hosting.VirtualPathProvider to virtualize an ASPX page,
the page compilation errors are replaced by an HttpException about a bad virtual path.

Thus, the impossible to understand the real source of the problem.
Details (expand)
Product Language
English

Version

.NET Framework 2.0
Operating System
Windows XP Professional
Operating System Language
English
Steps to Reproduce
The attached zip (VirtualPathBug.zip) contains a project to reproduce the problem.

Once you start the website, you can choose between 2 HTML links. Both links point to virtualized pages but:
- the first page compiles and there is no error
- the second page contains a syntax error and generates the error message
Actual Results
Below is the error message displayed in the browser when accessing the virtualized ASPX:

Server Error in '/WebSite' Application.
--------------------------------------------------------------------------------

The VirtualPathProvider returned a VirtualFile object with VirtualPath set to '/WebSite/Tata.aspx.cs' instead of the expected '//WebSite/Tata.aspx.cs'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The VirtualPathProvider returned a VirtualFile object with VirtualPath set to '/WebSite/Tata.aspx.cs' instead of the expected '//WebSite/Tata.aspx.cs'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): The VirtualPathProvider returned a VirtualFile object with VirtualPath set to '/WebSite/Tata.aspx.cs' instead of the expected '//WebSite/Tata.aspx.cs'.]
System.Web.Hosting.VirtualPathProvider.GetFileWithCheck(String virtualPath) +3443676
System.Web.FormatterWithFileInfo.GetSourceFileLines(String fileName, Encoding encoding, String sourceCode, Int32 lineNumber) +229
System.Web.DynamicCompileErrorFormatter.get_MiscSectionContent() +926
System.Web.ErrorFormatter.GetHtmlErrorMessage(Boolean dontShowSensitiveInfo) +831
System.Web.HttpResponse.WriteErrorMessage(Exception e, Boolean dontShowSensitiveErrors) +803
System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow, Boolean localExecute) +448
System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) +337




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1378; ASP.NET Version:2.0.50727.1378
Expected Results
The syntax error message like for the not virtualized ASPX pages.
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
1 attachments
VirtualPathBug.zip
Sign in to post a comment.
Posted by Microsoft on 11/1/2007 at 6:28 PM
Thank you for your feedback. We are currently investigating. The investigation process normally takes 7-14 days. If this issue is urgent, please contact support directly (see http://support.microsoft.com).

If at any time your issue is closed unsatisfactorily, you may edit your issue via Connect and change the status to “Active.”

Thank you,
Visual Studio Product Team
Posted by Microsoft on 11/2/2007 at 2:35 AM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

It may help if you provide us with:

a zipped project files

If we do not receive a response from you after 7-days , we will automatically close your issue. There is no obligation to respond -- at any time you may edit your issue via Connect and change the status to “Active.”

Thank you,
Visual Studio Product Team
Posted by Microsoft on 11/5/2007 at 9:37 PM
Thanks for your feedback.

We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team
Posted by Microsoft on 12/12/2007 at 10:17 AM
Dear customer,

Thank you for your feedback on this issue.

We have managed to reproduce the problem you described. When a file handled by a VirtualPathProvider contains compile errors, the actual compiler errors are not reported, but instead, an exception about an invalid path is reported. Indeed, this can cause confusion and make it difficult to identify the source of the problems.

We have investigated this issue and are developing a fix in our product. As a result, this problem should be fixed in the next release of our product.

We thank you for reporting this issue to us.