Bug 1239 - Parser failed with error Closing tag does not match opening tag.
Summary: Parser failed with error Closing tag does not match opening tag.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: 2.8 beta 3
Hardware: Macintosh Mac OS
: Lowest normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-10-04 13:42 UTC by KAFLAN
Modified: 2017-08-17 18:18 UTC (History)
5 users (show)

Tags: vsfmbb08
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description KAFLAN 2011-10-04 13:42:16 UTC
MonoDevelop 2.8 Beta 3 (2.7.22)
Operating System:
	Mac OS X
	Mono 2.10.6 (tarball Fri Sep 16 00:13:06 EDT 2011)
	GTK 2.24.5 (GTK#

while compile web site in MonoDevelop, i get this error: "Default.aspx(8,8): Warning: Parser failed with error Closing tag 'HeaderTemplate' does not match opening tag 'div'.. CodeBehind members for this file will not be added."
The error pointed to the last line of:
  <asp:Repeater runat="server" ID="rpt_hitdoor">
             <div class="hit_door">
                     Хиты продаж:</h2>
 i have googled the same problem, but in Visual Studio 2010: http://social.msdn.microsoft.com/Forums/en-US/vsarch/thread/92e37187-5e3b-4b21-abe0-247c275599af/
 Microsoft answer is shoking: Our parsing logic ... doesn't work 100% for ASP.Net syntax...
 And hint was, something like that: doesn't use Header/FooterTemplate
 and than i found: /monodevelop/main/x.x/src/addins/AspNetAddIn/Parser/Tree/RootNode.cs 
 with lines like:  if ( !(currentTagId != tagId))                                               throw new ParseException
 (location, "Closing tag does not match opening tag " + tagId + ".");                                       currentNode = currentNode.Parent;

So, this warning, stops web site build process and i getting errors like:
Error CS0103: The name `rpt_hitdoor' does not exist in the current context (CS0103)

becouse codebehind wasn't attached to CS file.
Comment 1 Mikayla Hutchinson [MSFT] 2011-10-04 13:53:08 UTC
MonoDevelop uses an old copy of Mono's ASP.NET parser for generating codebehind. I don't know whether this has been fixed in Mono. If it has, we should update the parser. If it hasn't been fixed in Mono, then it wouldn't matter if MD could generate the codebehind, because it wouldn't run on the server anyway.
Comment 2 KAFLAN 2011-10-04 14:42:27 UTC
how we can check does it fixed in Mono or not? I came from windows world, and didn't know how to build solution without MD directly by Mono.

I wonder, that i didn't found any info about this bug on the net, so, i think it cant be in current Mono, because this bug make Header/FooterTemplate unusable.
Comment 3 Mykola 2011-10-06 04:36:47 UTC
it's same in MonoDevelop 2.4 and 2.6. It can generate codebehind if HeaderTemaplate and FooterTemplate are removed. Then they can be re-added and app will build and run fine. 

But you need to do that every time when codebehind need to be regenerated.
Comment 4 KAFLAN 2011-10-06 05:56:06 UTC
Okey, Mykola, thank you for tip.
Comment 5 Amy Burns 2017-08-17 18:18:59 UTC
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.2, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.