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.
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.
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.