Having connectivity issue with Sage 50 US 2016 Quantum Accounting Edition

Hi All,

We are having connectivity problems with Sage 50 US 2016 Quantum Accounting Edition. The version of the Sage 50 is "23.2.00.0184". Our application is .Net application which is integrating with Sage 50 US. It is working fine on our end but it is throwing the following error in the customer end.

"Unable to cast COM object of type 'Interop.PeachwServer.LoginSelectorClass' to interface type 'Interop.PeachwServer.ILoginSelector'. This operation failed because the QueryInterface call on the COM."

Could you please help us to solve this issue?

Here is the code in the open connection.

public bool OpenConnection()
{
bool retval=false;
try
{
if (string.IsNullOrEmpty(mConnString))
BuildConnectionString(true, "", null);
if(!objPTSession.SessionActive)
objPTSession.Begin(Application_ID);
objCIDList = objPTSession.CompanyList();
objCID = objCIDList.Find(delegate(CompanyIdentifier o) { return o.CompanyName == mConnString; });
AuthorizationResult AuthResult = objPTSession.VerifyAccess(objCID);
if (AuthResult == AuthorizationResult.NoCredentials)
AuthResult = objPTSession.RequestAccess(objCID);

if (AuthResult == AuthorizationResult.Granted)
{
objCompany = objPTSession.Open(objCID);
retval=true;
}
else
{
throw new Exception("Sage 50 Authorization-" + AuthResult.ToString());
}
if (retval)
{
if (objApp == null)
{
object objTemp = connectPeachtree(sUserName, sPassword);

if (objTemp.GetType() != typeof(Exception))
{
objApp = (IApplication)objTemp;
if (objApp.CompanyIsOpen == false)
objApp.OpenCompany(objCID.Path);
}
}
}
}
catch (Exception ex)
{
//error handling
}
return retval;
}