我们有一个视图(.cshtml),它使用ASP.NET MVC 3为RSS提要呈现XML,工作正常.现在我们已经使用Razor 2升级到ASP.NET MVC 4,它会产生编译错误,类似于下面的内容.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Encountered end tag "item" with no matching start tag. Are your start/end tags properly balanced?
Run Code Online (Sandbox Code Playgroud)
标签是适当平衡的.
有人有什么想法?
更新:我已将它隔离在@foreach(...){...}块中item元素内的link元素下.
@foreach (var item in Model.Items)
{
<item>
<title>@item.Title</title>
<link>@item.Link</link>
<description>@item.Description</description>
<guid>@item.Guid</guid>
@if (item.PublishedDateUtc.HasValue)
{
<pubDate>@item.PublishedDateUtc.Value.ToString("ddd, dd MMM …Run Code Online (Sandbox Code Playgroud)