Trace not working in a .NET DLL loaded from VB6 EXE

前端 未结 2 2081
耶瑟儿~
耶瑟儿~ 2021-01-18 14:49

I have a .NET DLL that writes to the Trace. But it seems that when I call my DLL from a VB6 EXE the trace is not working.

I have created an myApp.config

2条回答
  •  情书的邮戳
    2021-01-18 15:43

    I think the problem is that VB6 is using COM to load your managed DLL.

    The .NET code won't load your .config file as it uses a single 'shim' handler for all COM Interop.

    The best you might be able to do is to add something to your machine.config file (but most people don't like doing that).

    Initialising tracing in code should work though. Remove your tracing configuration from the managed .EXE and run it in a debugger to check that the code version works there too.

提交回复
热议问题