小编O. *_*hai的帖子

Android Studio 2.3没有显示异常堆栈跟踪

我已经将Android Studio从2.2更新到2.3,现在当抛出任何异常时,它根本不会出现在"运行"部分.

我得到的只是"应用程序终止"的消息.

即使我故意抛出异常,堆栈跟踪也没有显示......

在此输入图像描述

android android-studio android-studio-2.3

6
推荐指数
1
解决办法
814
查看次数

没有 [ServiceFilter] 或 [TypeFilter] 的过滤器中的 Asp.net Core 依赖注入

我需要将一些具有依赖注入的服务注入到动作过滤器中。我熟悉[ServiceFilter]and[TypeFilter]方法,但它有点丑陋、凌乱和不清楚。

有没有办法以正常方式设置过滤器?不包裹我正在使用的过滤器[ServiceFilter][TypeFilter]?

例如我想要的:

[SomeFilterWithDI]
[AnotherFilterWithDI("some value")]
public IActionResult Index()
{
    return View("Index");
}
Run Code Online (Sandbox Code Playgroud)

代替:

[ServiceFilter(typeof(SomeFilterWithDI))]
[TypeFilter(typeof(AnotherFilterWithDI), Arguments = new string[] { "some value" })]
public IActionResult Index()
{
    return View("Index");
}
Run Code Online (Sandbox Code Playgroud)

它看起来很不一样,这种方法对我来说似乎不合适。

c# dependency-injection asp.net-core-mvc asp.net-core asp.net-core-2.1

4
推荐指数
1
解决办法
1382
查看次数