Bug 12929 - Implicitly closed tags preventing compliation
Summary: Implicitly closed tags preventing compliation
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: 4.0.9
Hardware: All All
: --- normal
Target Milestone: master
Assignee: Bugzilla
URL:
: 13558 13559 ()
Depends on:
Blocks:
 
Reported: 2013-06-27 19:48 UTC by alex
Modified: 2014-05-22 07:21 UTC (History)
4 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description alex 2013-06-27 19:48:28 UTC
The implicit closing of tags by previous tags is causing code compilation to fail.
Consider the following code snippet

<asp:Panel ID="panelEvent" runat="server">
    <asp:Label id="lblName" runat="server"></asp:Label>
    <br/>
    <asp:Label id="lblDescription" runat="server"></asp:Label>
</asp:Panel>

Causes the following warnings:
Warning: Tag 'asp:Panel' implicitly closed by tag 'br'.

And the following compile error:
Error: Closing tag 'asp:Panel' does not match any currently open tag.

This implicit closing of open tags by non matching tags is causing our solution builds to fail under all versions of Xamarin Studio since v4.0.5, and has been present in all versions since. Because of this, our company are having to run older versions of Xamarin Studio, or even MonoDevelop in order to successfully build our ASP.Net application so it can be tested.

We have Windows, Linux and Mac computers in our office, and this problem is appearing on all of them, so it isn't platform specific.

Thanks.
Comment 1 Mikayla Hutchinson [MSFT] 2013-06-27 19:55:06 UTC
Are you sure you see this on 4.0.9? I can't repro this with master, and I'm pretty sure the fixes made it into 4.0.9.

https://github.com/mono/monodevelop/commits/monodevelop-4.0.9-branch/main/src/addins/AspNet
Comment 2 alex 2013-06-27 20:36:11 UTC
Xamarin is definately running v4.0.9. We're also getting the same error on HTML tags as well eg Warning: Tag 'td' implicitly closed by tag 'table'.
Comment 3 Mikayla Hutchinson [MSFT] 2013-06-27 21:03:45 UTC
I cannot reproduce any problems with your asp:Panel snippet in master, current alpha (4.1.4), current stable (4.0.9) nor previous stable (4.0.8). I'm going to need a more complete sample.

The fix for the td tags was contributed to master:
https://github.com/mono/monodevelop/commit/e2af0e954bdcf69ef5492f256e749a1b6f6ce7d2
Comment 4 Michael Thwaite 2013-07-02 08:01:49 UTC
Confirmed on 4.0.9 also.

As soon as I added the h1 tags to this code, the td above reported that it was implicitly closed.


<%@ Page Language="C#" Inherits="myFoodDays.Error" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>Error</title>
		<link href="Styles.css" type="text/css" rel="stylesheet" />
	</head>
	<body>
		<form id="Form1" method="post" runat="server">
			<asp:label id="Label1" style="Z-INDEX: 115; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server"
				Font-Size="Medium" Font-Names="arial" Font-Italic="True" Font-Bold="True">Nothing to show</asp:label>
			<table id="Table1" style="Z-INDEX: 116; LEFT: 8px; WIDTH: 640px; POSITION: absolute; TOP: 40px; HEIGHT: 36px"
				cellspacing="0" cellpadding="1" width="640" border="0">
				<tr>
					<td style="WIDTH: 659px">
					<h1></h1>
						<asp:label id="lblInstructions" runat="server" Width="632px" Font-Size="X-Small" Height="103px">The information needed to show this page has not yet been entered, refer to your myFoodDays administrator for guidence or press the back button on your browser to return to the last page.</asp:label></td>
				</tr>
			</table>
		</form>
	</body>
</html>

I've tried to trim the td tag to just <td> and the issue still occurs. All returns to normal when I remove the <h1> tags.
Comment 5 Michael Thwaite 2013-07-02 08:07:25 UTC
Confirmed on 4.1.4 as well.
Comment 6 Michael Thwaite 2013-07-02 08:16:36 UTC
I don't know it it helps but, in another page that compiles on 4.0.3 fine but fails on 4.0.8,9 displays a red underline under "asp" in the following code. It's the first instance of any asp in the page. There are no details for the error when I mouse over:

</script>
<asp:UpdatePanel ID="UpdatePanelMain" runat="server">
	<ContentTemplate>
Comment 7 Mikayla Hutchinson [MSFT] 2013-07-02 18:00:44 UTC
The example in comment 4 works fine on master too, it must have been fixed by the fixes I linked.
Comment 8 Michael Thwaite 2013-07-03 06:58:05 UTC
Hang on a second, it doesn't work here for us, does that mean game-over for us? How do _we_ carry on using Xamarin, surely you're not saying that we have to stick with 4.0.3 which is the only older version I have.

It'd been reported fixed in the master after the release of 4.0.8 so we were waiting for an update, that arrived in 4.0.9 but the problem still exists, how do we verify that your fix works for us? Do we wait for 4.0.10?
Comment 9 Mikayla Hutchinson [MSFT] 2013-07-03 12:48:35 UTC
It means the bug appears to have been fixed and you need to wait for the next non-hotfix release, or build from source.
Comment 10 Michael Thwaite 2013-07-26 11:10:12 UTC
This issue is still present in 4.0.10 but resolved in Alpha release 4.1.7.
Comment 11 Michael Thwaite 2013-07-29 08:06:08 UTC
However, this now generates an error:
<td><asp:TextBox ID="txtNameInsert" MaxLength="500" runat="server" Text="<%#Eval("Name") %>"/></td>

Unexpected '<'
Comment 12 Mikayla Hutchinson [MSFT] 2013-07-29 12:28:07 UTC
*** Bug 13558 has been marked as a duplicate of this bug. ***
Comment 13 Mikayla Hutchinson [MSFT] 2013-07-29 15:11:07 UTC
*** Bug 13559 has been marked as a duplicate of this bug. ***
Comment 14 Mikayla Hutchinson [MSFT] 2013-07-29 15:22:45 UTC
FYI that is filed as bug 12832.
Comment 15 Sadik Ali 2014-03-31 04:53:23 UTC
I have verified this issue, I followed below steps:

1. Created new Web Application
2. Added code mentioned in bug description.
3. Build application and noticed that I am not getting any warning or error message.
4. Added code mentioned in comment 4
5. Getting below error message when build application.
Error: The tag type 'asplabel' has not been registered. for the tag <asp:label

6. I changed asp:label to  asp:Label and application build successfully

Screen cast: http://screencast.com/t/wBcfGTNy3B

Build Environments:

=== Xamarin Studio ===
Version 4.2.4 (build 266)
Installation UUID: 400bab6b-f5cd-4e84-a1d1-39f9d6414cb1
Runtime:
 Microsoft .NET 4.0.30319.18449
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.25

=== Xamarin.Android ===
Version: 4.13.0 (Trial Edition)

=== Build Information ===
Release ID: 402040266
Git revision: 57fa6b7639703775ae1d5c46536e42ab424cb177
Xamarin addins: eee141c29724a19529e77b8e743086d95b29f5ba

=== Operating System ===
Windows 6.2.9200.0 (64-bit)

Also Verified on MAC machine.

I am marking this as verified as per my observation. 

Please let me know if mentioned error in steps 5 is an issue.
Comment 16 Niels Heinemann 2014-05-21 10:02:15 UTC
This Bug seems to be still present in monodevelop 4.2.2 :/

Compiler error with:

<li><strong>Anzahl Pl&auml;tze: <%# Count %></strong>
                  <p>Die Anmeldefrist f&uuml;r den <%= GetText("Event") %> ist abgelaufen. 
                  Eine Anmeldung ist in diesem Jahr leider nicht mehr m&ouml;glich.</p>
</li>

and

<h2><%# Name %> <br /> 
    <small><%# Name_add %></small>
</h2>	

Any ideas?
Comment 17 Niels Heinemann 2014-05-22 07:21:31 UTC
Same in 4.2.2.2 and 4.2.3, both built from source...