After converting my application to use the Milestone Nuget packages, I get a ‘System.NullReferenceException’ during the login process at MultiUserEnvironment.Unitialize.
This causes a failed login. But then if I login again it works correctly. I must be missing something? Has anyone else seen this - thank you
Often we see a mix of old and new dlls causing this kind of issue. Please make sure you remove the old references but also clear away any dlls and start from scratch.
Perhaps as a extra check try a new sample that uses the NuGet and was never using direct dll ref. https://github.com/milestonesys/mipsdk-samples-component-
(There is a Multi-User Environment sample.)
If that doesn’t help could you please provide the full exception text including stack trace information?
An update to this: I installed API version 22.3.0 for all components and it worked fine. Then I install version 23.1.1 for the VideoOS.Platform and VideoOS.ConfigurationAPI. But when I update VideoOS.Platform.SDK to 23.1.1 or 23.1.2 i get the Nullreference exception. I would like to upgrade this to take advantage of the bug fix that it refers to. I don’t see any changes to ‘MultiUserEnvironment’ between 22.3 and 23.1. I am running Milestone Corporate 2022 R3 - if that matters - thank you
We (Milestone Support) would very much like to understand what you experience, please let us see the full error text.
thank you:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=VideoOS.Platform.SDK
StackTrace:
at VideoOS.Platform.SDK.MultiUserEnvironment.UnInitialize()
at Secure365.Utility.AuthenticatorPlugin.Uninitialize() in [C:\Users\admin\source\repos\Secure365\src\Secure365\Authentication\AuthenticatorPlugin.cs](file:C:/Users/admin/source/repos/Secure365/src/Secure365/Authentication/AuthenticatorPlugin.cs):line 78
Line 78:
MultiUserEnvironment.UnInitialize();
Works fin in previous API versions of VideosOS.platform.sdk
I reproduced the issue. It was easy for me to reproduce using the MultiUserEnvironment sample, if you run the sample and then immediately hits the close button you see the exception. But if you then build the sample sample using the 22.3.0 NuGet packages instead there is no exception.
I will report this to Milestone Development and let you know what they find..
Note that in my testing this only happens when the MultiUserEnvironment was not initialized or the Uninitialize was run twice. I suggest that you for a quick resolution handle this situation. One possible solution is to catch the exception and ignore it!