Facing issue in upgrading MIP SDK from 2020R2 to 2024R2

In our project we have a bridgeservice(based on xprotect smart client) which connect Niagara station to Xprotect server.

Current version of dlls used in bridgeservice native app is 2020R2 which is working fine. But when we try to upgrade it to 2024R2 then bridgeservice is not able to

connect Niagara station to xprotect management server.I checked all the previous versions to find out the breaking point and observed that till 2020R3 dlls it is working fine but 2021R1 onwards we are not able to upgrade.

DLL’s used for 2024R2

DLL’s used for 2023R3

image

Actually in 2021R1 onwards after hitting “VideoOS.Platform.SDK.EnvironmentService.Login” , it is throwing “ExceptionVideoOS.Platform.SDK.Platform.ServerNotFoundMIPException” but with same code is working fine for older 2020R3 dlls. we could not debug further as this login method is part of SDK. And same code is working fine till 2020r3 dlls.

. Also we followed milestone sample code guide https://doc.developer.milestonesys.com/html/gettingstarted/intro_environments_login.html

Please find some of the code snippets below:

public LoginAttributes LoginBasic(string userName, string password, Uri uri)

{

  CredentialCache cc = VideoOS.Platform.Login.Util.BuildCredentialCache(uri, userName, password, "Basic");

  VideoOS.Platform.SDK.Environment.AddServer(false,uri, cc,false);

  Console.WriteLine("---(inside MIPService.cs/LoginBasic)---> before invoking invokeLogin(uri): uri =" + uri+ " --- uri.GetType :" + uri.GetType());

  return invokeLogin(uri);

}

public LoginAttributes LoginWindows(string domain, string username, string password, Uri uri)

{

  NetworkCredential nc = new NetworkCredential(username, password, domain);

  VideoOS.Platform.SDK.Environment.AddServer(uri, nc);

  Console.WriteLine("---(inside MIPService.cs/LoginWindows)---> before invoking invokeLogin(uri): uri =" + uri);

  return invokeLogin(uri);

}

public XmlElement GetServers(String serverId)

{

List list = Configuration.Instance.GetItems(ItemHierarchy.SystemDefined);

Item server = FindServer(serverId, list);

//just get the direct children of this server (should be recording servers)

XmlDocument doc = MakeNewXmlDocument();

foreach (Item child in server.GetChildren())

{

 if (!child.FQID.Kind.Equals(Kind.Server)) continue;

 SerializeItem(doc, child, false);

}

return doc.DocumentElement;

}

public XmlElement GetConfiguration()

{

List list;

list = Configuration.Instance.GetItems(ItemHierarchy.SystemDefined);

XmlDocument doc = SerializeList(list, true);

return doc.DocumentElement;

}

[region](javascript:void(0); “region”) Login Utilities

private LoginAttributes invokeLogin(Uri uri)

{

try

{

 Console.WriteLine("---(inside MIPService.cs/invokeLogin)---> before invoking VideoOS.Platform.SDK.Environment.Login(uri): uri =" + uri);

 //VideoOS.Platform.SDK.Environment.Login(uri);

 VideoOS.Platform.SDK.Environment.Login(uri, new Guid("xxxxxxb1-fafd-4cb5-abae-019d930dxxxx"),"Niagara","2.0","Honeywell",false);

 Console.WriteLine("---(inside MIPService.cs/invokeLogin)---> Login completed :uri =" + uri);

}

catch (Exception e)

{

 VideoOS.Platform.SDK.Environment.RemoveServer(uri);

 throw e;

}

return GetLoginAttributes(uri);

}

private LoginAttributes GetLoginAttributes(Uri uri)

{

LoginSettings ls = LoginSettingsCache.GetLoginSettings(uri.DnsSafeHost);

LoginAttributes la = new LoginAttributes();

la.Token = ls.Token;

la.TokenTimeToLive = ((long)ls.TokenTimeToLive.Subtract(DateTime.UtcNow).TotalMilliseconds).ToString();

la.uri = ls.Uri;

la.serverid = ls.Guid.ToString();

Console.WriteLine(“—(inside MIPService.cs/GetLoginAttributes)—> before invoking VideoOS.Platform.SDK.Environment.Login(uri): uri =” + la.Token+ " la.uri "+ la.uri+ " la.serverid "+ la.serverid);

return la;

}

Can somebody suggest how to fix login issue in latest SDK ? Also need help on how to enable internal log so that I could debug login issues better.

Thanks,

In 2021R1 the authentication was changed.

Read more - https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/mip2021r1_intro.html&tree=tree_home.html

The solution is to build the application again using the new MIP SDK NuGet packages.

I suspect that if you tried this, and it is not working, that you have a mix of old dll’s and new from the NuGet. Please as a first make sure the project is cleaned and no of the older dependent files are left over. You should change your project from using direct dll to using NuGet when using the newest MIP SDK version.