Configuration.Instance.GetItems().Count == 2 // WindowsFormApplication.
Configuration.Instance.GetItems().Count == 0 // WindowsService.
The above are results are produced from mostly the same code.
- I’d like a clue why the service did not also produce Count == 2.
- Also, why did the Service return Count == 0 instead of an Exception?
I’m pretty sure this WindowsService used to work the same as my WindowsFormApplication, but was many months ago and I don’t know what code could have changed.
… I found a difference in the versions of code…
Would the following be an issue causing No-Items to return (see “GOAL”)?
I am calling this line in both Form and Service…
VideoOS.Platform.SDK.Environment.Initialize();
After the above line, the next line is also called only in the Form version of the App…
VideoOS.Platform.SDK.UI.Environment.Initialize();
GOAL: Count > 0 for…
List cameraFolder = Configuration.Instance.GetItemsByKind(Kind.Camera);
You should get the same result. My suspicion is that you are running as different users when running as the service and as the application. What user credentials do you use?
I’m having this same issue. I’m using the same credentials on two different WPF applications, with one I’m able to discover all items but with the other I’m getting a different count
That sounds really strange.
Are you running the two applications on the same machine?
And what type of credentials are you using? Current Windows user, a specific user (provided at login) or a basic user?
What code do you use to collect the items in the two applications?
And finally, which model/version of XProtect and the MIP SDK are you using?
Yes, they’re both running on the same machine. I am using a Basic user with SDK version 2019 R1
I believe that it might be a dll issue, both my client and server applications build to different folders. I seem to be getting the correct response on the client side
I tried copying all the same milestone dependencies to my server build folder with no luck. Could you tell me which dlls are required to for the GetItems method to return the correct response?
If you are getting any items at all I really doubt it is a dll issue. Also it is only the basic VideoOS.Platform.* dlls that are required for configuration access.
You mention the one providing the wrong result is a server application. Is it running as a service? If so how do you ensure correct credentials are used?
No, it isn’t running as a service. The credentials are hardcoded into the Util.BuildCredentialsCache method
When I run the GetItems method within the server application, the return item contains a single item with the name “192.168.5.121” which is the Milestone URI
Within the FQID field the ObjectId is all 0s and the ServerId ServerType is set to “XP” whereas it is “XPCO” when run on the client
Normally GetItems will only return the top-node(s) and you then need to call GetChildren recursively on that/those node(s). What happens if you call GetChildren on the returned item?
I get 0 children, which isn’t correct.
When running on the client I see the correct nodes and am able to retrieve all devices with the GetChildren method
which version of XProtect VMS are you logging in to?
and could you please check the logs in [c:\ProgramData\Milestone\MIPSDK\](file:c:/ProgramData/Milestone/MIPSDK/) if it contains anything.
Also, could you please try and download the latest MIP SDK (2020 R3) and see whether the problem keeps occurring with that version. You can always use the latest SDK version no matter the XProtect version.
Hmm, I see that my server side code is not generating a log entry at all
On the client side I can see a log entry with the login token and license information
Hi, do you have any idea why this might be happening?
You have not yet answered a couple of my previous questions regarding versions. Also I am a bit confused since you previously said that both applications were running on the same machine, but how can you then see which of the two is generating the logs? And if it is really the case that only one are writing logs it sounds like you might have a problem with user rights for the server application?