quando coloco o
<ul>
@foreach (var livro in ViewBag.Livros)
{
<li>@livro.Titulo - @livro.Autor</li>);
}
</ul>
o @ não está sendo reconhecido. Consigo rodar a aplicação porem quando entro na URL http://localhost:5000/Livros/ParaLer tenho o erro abaixo: An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately. Generated Code One or more compilation references are missing. Ensure that your project is referencing 'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false.
} expected + EndContext(); } expected + EndContext(); Identifier expected + BeginContext(283, 11, true); Type expected + BeginContext(283, 11, true); Identifier expected + BeginContext(283, 11, true); Type expected + BeginContext(283, 11, true); Identifier expected + BeginContext(283, 11, true); Syntax error, ',' expected + BeginContext(283, 11, true); Type expected + BeginContext(283, 11, true); Identifier expected + BeginContext(283, 11, true); Syntax error, ',' expected + BeginContext(283, 11, true); Method must have a return type + BeginContext(283, 11, true); Identifier expected + WriteLiteral(" \r\n"); Method must have a return type + WriteLiteral(" \r\n"); Type or namespace definition, or end-of-file expected + ); A namespace cannot directly contain members such as fields or methods + _MicrosoftAspNetCore_Mvc_Razor_TagHelpers_BodyTagHelper = CreateTagHelperglobal::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper(); Type or namespace definition, or end-of-file expected + . . .