c# - .Net Framework - 无法调试 Owin API 控制器
问题描述
我在 .NET Framework 4.8 中有一个使用 Owin 的 Web API。我有以下启动代码:
_callHttpServer = WebApp.Start(
callServerOwinStartOptions,
(appBuilder) =>
{
var httpConfig = new HttpConfiguration();
httpConfig.MapHttpAttributeRoutes();
httpConfig.EnsureInitialized();
httpConfig.ConfigureSwagger();
appBuilder.UseWebApi(httpConfig);
}
);
但是,当我在我的一个ApiController
类中设置断点时,它永远不会被命中,即使我知道路由正在运行。此外,我看不到Console.WriteLine()
添加到控制器的任何语句的输出。
有什么问题?我该如何进行这项工作?
解决方案
推荐阅读
- google-sheets - 如何使用 IMPORTXML 公式引用引用中的单元格?
- entity-framework-core - 修复 EF Core 加载相关数据的预期行为是什么
- php - WooCommerce - 我的帐户页面将锚链接添加到注册部分
- python - 如何在 PySpark 中使用 UnaryTransformer?
- json - 访问 JSON 对象中的单个属性
- django - Django CMS - 无法重新排序子插件
- tensorflow - 创建空间变压器网络时无错误
- python - 在 Kaggle 上导入自己的 Python 模块
- linux - mkdir 函数的一半有效,但 cd 部分无效
- discord.py - 消息发送命令有问题