This seems very strange to me, if I do
@RenderSection("scripts", required: false) then it works perfectly fine, but if I do
@{ RenderSection("scripts", required: false); } then the scripts section will not get rendered and I would get "The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "scripts"." error
Any idea why RenderSection/Script.Render cannot be inside a code block?
Edit: I have tried to put a break point inside the code block and the break point is getting hit when the page loads, and the RenderSection method executes without any exception