The finalizer for the LogonManager instance should not be called directly, use a “using” statement instead. At LogonManager.Finalize()

By | April 5, 2010

The finalizer for the LogonManager instance should not be called directly, use a “using” statement instead. At LogonManager.Finalize()

If you are writing code for CRM Online install, chances are that you would receive the above error when trying to execute your code.

Currently you would have used a similar code block

// Retrieve a Windows Live ticket from the Live service.
LogonManager lm = new LogonManager();
string passportTicket = lm.Logon(“someone@microsoft.com“,
“password”, “crm.dynamics.com”, policyResponse.Policy, “Production”);

Try instead to use the using block as advised. Change this section of the code to

using(LogonManager lm = new LogonManager())
{
string passportTicket = lm.Logon(“someone@microsoft.com“,
“password”, “crm.dynamics.com”, policyResponse.Policy, “Production”);
}

Precautions to be taken when installing a CRM Online piece of code on any system.

1. Make sure you have copied the msidcrl40.dll to the system32 folder.
2. Use the Microsoft.CRM.SDK.dll and Microsoft.CRM.SDK.dll provided in the sdk for specifically CRM Online
3. The idcrlwrapper comes along with a supporting registry file in the SDK folder. Make sure you install the registry entries.
4. Be sure to use the 64 bit version for all of the above if trying to install it on a 64 bit platform.

Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *