-
Notifications
You must be signed in to change notification settings - Fork 23
Unhandled Exception: System.NullReferenceException: #12
Comments
I'm also getting this on an clean Windows 10 Lenovo 20L7S2A000 (Thinkpad T480s) |
I've ran v1.0.1 in debug mode on that asset and the lines of code it bombs out on is : 27/02/2019 10:15:49: Started application. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. Looks like it's this part |
Ok I've ran Visual Studio 2017 on the problem asset Stepping through the PropertyValues that come in. WMI Query at the time SELECT Manufacturer,Model,SerialNumber,Size FROM Win32_DiskDrive HDD Details on this device Manufacturer(Standard disk drives) ModelGeneric- SD/MMC USB Device SerialNumber2012090114345300 Size512105932800 Taking out Size from (Line 322 on Marksman.cs) mySentry.AddQuery("WMI", "SELECT Manufacturer,Model,SerialNumber, FROM Win32_DiskDrive"); Lets the App continue |
Hi boingball, thanks for looking into this. Is there any chance you could build this for me without the size query as the assets which are failing are all with SD readers. Sorry im not versed in compiling visual studio projects and attempted this myself but didn't get very far |
This is the Marksman.exe file without the Size part of the WMI query in it I can't make a full installer as my Visual Studio 2017 is incompatible with the Setup program. |
Thank you for investigating it. Also, if there are features that you think are missing, please create an issue. |
Hi Velaar, Will do. I'm using a custom version of your 1.0.1 code and I added CPU Name, OS Version, Memory Size + Model Name - I also fixed the Mac Address adder (It was trying to use a different field name to the one in my SnipeIT database) I run this Marksman.exe as part of our PXE network build - so when a computer is built, it runs Marksman automatically and add's this to SnipeIT with the custom details I want. I could do with a Marksman that could update current assets but looking at the code there's a lot to program to make that happen. Cheers, |
Iam getting this error. 2019-07-24 14:28:09: Started application. Ohanterat undantag: SnipeSharp.Exceptions.RequiredValueIsNullException: Property Manufacturer cannot be null. |
I'm gonna bump this, it still seems to be broken on version 1.5 which hasn't been stated by other people. Even building from scratch. |
UPDATE: I found my problem to be with removing keys "<add key=" in the config file. I am getting unhandled exceptions as well on 1.5: 1/27/2020 11:57:34 AM: Started application. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. Also tried patched Marksman.zip from boingball - Same result. |
I was also suffering from this - I had diagnosed it as an issue with the DiskDrive WMI query and traced it down to the "Windows Sandbox" feature. It looks like some of the information the query looks for isnt available for the "Portable Base Layer" VHD that Microsoft use as the Windows Sandbox location. I replaced line 322 with the below to get the "correct" drive, now runs without a hitch! I'll submit a PR with this change, I believe that Index 0 should always the drive where Windows is running from. |
Is it possible for you to recompile it and release a new version with this problem fixed? |
Hi Mike, thanks for the pull request. I'll release a recompiled version this weekend. |
Hello Daniel, Were you able to recompile a new version? Thanks |
Any update? |
HI also Having issues - Please Help would love an agent for snipe-it :\Program Files (x86)\Scope-IT\Marksman>Marksman.exe Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Boolean'. Path 'rows[0].eula', line 1, position 134. ---> System.InvalidCastException: Null object cannot be converted to a value type. |
Hi,
First off thank you for this agent, it has saved me allot of time!
Unfortunatley though on a fresh windows 10 install that has been updated through windows update I get this error 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)
Any assistance would be appreciated
The text was updated successfully, but these errors were encountered: