Tuesday, December 30, 2008

CRM Online - InitializeEx() failed.

I created an ASP.net form and I tried to post the form data to CRM via the CRM web service. I was able to run the application locally on my development machine, however when I deployed my project to the server, I received the InitializeEx() failed error. The stack trace shows the following:

[ApplicationException: InitializeEx() failed.]
Microsoft.Crm.Passport.LogonManager.Initialize(String environment) +349
Microsoft.Crm.Passport.LogonManager.Logon(String userName, String password, String partner, String policy, String environment) +30

The reason that you received this error message is because the default app pool user does not have permission to initiate the msidcrl40.dll file which called by the IdCrlWrapper.dll

To resolve this issue, I added the following line to my web.config file

<identity impersonate="true" userName="[LOCAL ADMINISTRATOR USERNAME]" password="[ADMIN PASSWORD]" />
If you don't want to touch the web.config file, you may do it through your IIS if you have access to it. Right click on your web site to open up the Properties of your Web site, then click on the ASP.NET tab, then click on the Edit Configuration button.


ScreenHunter_01 Jan. 06 14.43

On the ASP.Net configuration setting screen, click on the Application tab. Check the Local Impersonation checkbox in the Identity settings section. Enter the local Administrator user name and password, then click OK to close the opened windows.

ScreenHunter_02 Jan. 06 14.45

I tried to run my application again and I was able to insert records into CRM from my ASP.net form now. Hope this can help you in your next CRM project.

3 comments:

John said...
This comment has been removed by the author.
John said...

Hi im having same problem using the webservice too, can you show us your code on connecting and posting it to crm?

thanks in advance

John said...
This comment has been removed by the author.