Is it possible to use the logical call context within a unit test in VS 2010?

后端 未结 4 544
予麋鹿
予麋鹿 2020-12-30 03:32

Is it possible to make this test not throw an exception? It appears that adding any non-GACed class into the logical call context causes an exception to be thrown in line 2

4条回答
  •  北海茫月
    2020-12-30 04:24

    When using logical CallContext to store objects implement the appropriate finalization logic (IDisposable) to clean up objects stored in the CallContext (e.g.: CallContext.FreeNamedDataSlot)

    Hope this helps,

    Juanjo

提交回复
热议问题