使用附加程序的方式来进行调试
image.png注意这里的指向
image.png
使用attach来调试正在运行的程序,选择项目名称.dll的路径
image.png
image.png
撞到断点了,ok
image.png
这里为了撞到下面的断点把[ApiController]这个attribute去掉了,实际上这个attribute的作用就是为我们返回验证后的错误,当然还有很多其他的功能
// 摘要:
// Indicates that a type and all derived types are used to serve HTTP API responses.
// Controllers decorated with this attribute are configured with features and behavior
// targeted at improving the developer experience for building APIs.
// When decorated on an assembly, all controllers in the assembly will be treated
// as controllers with API behavior.
网友评论