相关疑难解决方法(0)

反射器的开源替代品?

只是想知道是否有人知道RedGate的Reflector的开源替代品?我很想知道一个类似于Reflector的工具是如何工作的.

请注意,如果您知道Reflector 的免费但开源替代方案,您可以回答以下相关问题:

摘要 - 2011年5月11日更新

快速汇总已建议的各种开源项目和工具:

  1. 通用编译器基础结构(CCI)
  2. 单声道塞西尔
  3. ILSpy
  4. dnSpy(ILSpy的分支,项目看起来比原来更活跃)
  5. Dotnet IL编辑器(DILE)
  6. IL.View
  7. Monoflector(截至2011年4月不再有效)

以下资源也可能是有意义的:

  • TypeView.cs
  • Jason Haley关于拆解.NET的说明
  • Adrian Bank最近的博客文章总结了许多Reflector的替代方案,包括下面没有提到的几个选项.
  • Mark Lichtenberg的详细博客文章将几个开源替代品(DILE,ILSpy和使用MonoDevelop的Mono Cecil)与Reflector进行了比较.

.net reflection reflector open-source

419
推荐指数
8
解决办法
12万
查看次数

捕获可能从Subscription OnNext Action抛出的异常

我对Rx.NET有些新意.是否有可能捕获任何订阅者可能抛出的异常?采取以下措施......

handler.FooStream.Subscribe(
            _ => throw new Exception("Bar"),
            _ => { });
Run Code Online (Sandbox Code Playgroud)

目前,我正在以每个订阅为基础,使用以下实例.其实现只使用ManualResetEvent来唤醒等待的线程.

public interface IExceptionCatcher
{
    Action<T> Exec<T>(Action<T> action);
}
Run Code Online (Sandbox Code Playgroud)

并像这样使用它......

handler.FooStream.Subscribe(
            _exceptionCatcher.Exec<Foo>(_ => throw new Exception("Bar")), //It's disappointing that this generic type can't be inferred
            _ => { });
Run Code Online (Sandbox Code Playgroud)

我觉得必须有更好的方法.Rx.NET中的所有错误处理功能是否专门用于处理可观察到的错误?

编辑:根据请求,我的实现是https://gist.github.com/1409829(接口和实现分为prod代码中的不同程序集).欢迎反馈.这可能看起来很愚蠢,但我正在使用城堡windsor来管理许多不同的Rx用户.此异常捕获器已在此容器中注册

windsorContainer.Register(Component.For<IExceptionCatcher>().Instance(catcher));
Run Code Online (Sandbox Code Playgroud)

然后就像这样使用observableIObservable的实例:

var exceptionCatcher =
    new ExceptionCatcher(e =>
                                {
                                    Logger.FatalException(
                                        "Exception caught, shutting down.", e);
                                    // Deal with unmanaged resources here
                                }, false);


/* 
 * Normally the code below exists in some class managed …
Run Code Online (Sandbox Code Playgroud)

c# asynchronous exception-handling subscription system.reactive

9
推荐指数
1
解决办法
3004
查看次数