Scope-IT / marksman

Windows agent for Snipe-IT asset management system
Apache License 2.0
129 stars 23 forks source link

Does not work on virtual devices #26

Closed vinc2019 closed 4 years ago

vinc2019 commented 4 years ago

Unfortunately, I get all the virtual devices no matter whether PC or server the following known message:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Marksman.Sentry.RunWMI() at Marksman.Marksman.Main(String[] args)

Does anyone have the same problem with the virtual devices and does anyone know a solution? Thank you very much for your help.

danielhogg commented 4 years ago

Thanks for the bug report. A few questions:

  1. Can you give an example of a virtual device that returns this error?
  2. Do you mean virtual machines, i.e. a VM running inside a host machine?
vinc2019 commented 4 years ago

Yes, that is exactly what I mean, virtual machines running inside a host machine We have different virtual clients and servers in our Hyper-V environment. And also on my W10 Machine with a test Hyper-V environment, it does not work.

vinc2019 commented 4 years ago

I found out that I do not have the problem with virtual W7 machines. It only appears on W10 and Server 2016.

danielhogg commented 4 years ago

@velaar Does it make sense to support virtual machines? This was originally written as a utility to keep track of hardware inventory, not VMs and containers.

vinc2019 commented 4 years ago

I think you're right. I only use the VM computer for testing. The problem also appears on physical devices with the Windows 10 not on Windows 7. Can it be that it runs only with certain .Net versions? Is there a possibility to activate a deepening debugging? Or better said, a possibility to see more logs? I can't solve the problem, it is frustrating.

velaar commented 4 years ago

@velaar Does it make sense to support virtual machines? This was originally written as a utility to keep track of hardware inventory, not VMs and containers.

VM is such a niche case. I think it can be achieved with a settings switch for testing purposes. However there are so many different VMs around and Windows WMI reacts in different ways to what they emulate. I think shouldn't implement this support as there is little practical value.

Close the case?

danielhogg commented 4 years ago

Agreed. Given that this is a hardware inventory tool, I'm not sure it makes sense to include VMs.