在核心 3.0 Web API 中处理请求时发生未处理 asp.net 异常



我正在尝试运行NET Core 3.0 WebAPI项目,但收到以下错误

An unhandled exception occured while processing the request in asp.net 
core 3.0 web api

错误消息单击此处显示

根据您收到的错误,这:

[ApiController]
[Route("[controller]}")]//the example have extra `}` here 
public class WeatherForecastController : ControllerBase

生成以下错误:

检查每个"{"字符是否具有匹配的"}"字符。

您需要检查WeatherForecastController的属性路由及其Get操作,以查找是否有任何额外的{/}或缺少括号。