none
Sending and capturing WMI events in .Net RRS feed

  • Question

  • Hi, I have the following situation:

    I have different .net services that are instrumented using WMI custom events. The events are defined in a shared assembly. Here is what I experienced: if the shared assembly is not exactly the same binary, then I have different issues, like events are raised by one process but are never intercepted by WMI.

    This is - I guess - due to the fact that the MOF (in c:\windows\system32\wbem\framework\root\[namespace]) gets regenerated if the MVID of the assembly is not the same between the different processes.

    This is an issue for me because I often have to deploy an updated version of just one service, and doing so the shared assembly gets recompiled, thus changing its MVID (but not changing anything about WMI events). The effect I see is that, whenever a process raises a WMI event whose class is defined in this shared assembly, it is lost, that is, there is no trace of it in any Notification Query done using wbemtest.

    Can someone shed some more light into this issue?

    Monday, October 22, 2012 9:50 AM

Answers

  • Hi Gcannata,

    Response from MSFT:

    I believe this is by design.  If you are going to have services that are being updated at different times, you are going to need to not have a shared assembly here.  If you want to aggregate the statistics in some way, you will have to do it after the fact.

    I think we probably need to reach out to the product team to be certain in this case, but there is a workaround, albeit one that requires a bit of refactoring of your design.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by gcannata Wednesday, November 7, 2012 9:38 PM
    Monday, October 29, 2012 4:59 AM
    Moderator

All replies

  • Hi Gcannata,

    Welcome to the MSDN Forum.

    I am try to involving some other one in this thread.

    Thank you for your patience.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, October 26, 2012 6:36 AM
    Moderator
  • Hi Gcannata,

    Response from MSFT:

    I believe this is by design.  If you are going to have services that are being updated at different times, you are going to need to not have a shared assembly here.  If you want to aggregate the statistics in some way, you will have to do it after the fact.

    I think we probably need to reach out to the product team to be certain in this case, but there is a workaround, albeit one that requires a bit of refactoring of your design.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by gcannata Wednesday, November 7, 2012 9:38 PM
    Monday, October 29, 2012 4:59 AM
    Moderator
  • Thank You Mike, I guess this is the case.

    Still I reckon this part is not broadly documented, maybe because a bit esoteric, and I wonder how in Microsoft you deal with this.

    For example in Enterprise Library you use WMI as a log listener, what would happen if on the same machine different version of EntLib are used? Just wondering, of course.

    Wednesday, November 7, 2012 9:42 PM
  • Hi Gcanata,

    As you know, it is not documented, so I cannot talk more about this.

    I hope you could understand and support.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, November 8, 2012 5:37 AM
    Moderator