Asp.net mvc compiler error when trying to invoke View Component from view page
问题 I am trying to create my first View Component in my MVC project but have come to a halt. When I try to invoke my View Component from the razor view page I get an error that states: "The name 'await' does not exist in the current context". Code I use to call the View Component: @await Component.InvokeAsync("Example") View Component class: namespace MyWebApp.ViewComponents { public class ExampleViewComponent : ViewComponent { public IViewComponentResult Invoke() { var user = Account.GetCurrent(