locked
In CRM 4, callout is receiving "An error occurred" error. RRS feed

  • Question

  • Hi,

    I have a callout that worked in CRM 3 and is now not working in CRM 4.0. I am receiving a popup window when the callout is executed. The window says:

    An error occurred.

    Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator.

    I have verified the following:
    -I have the callout.config.xml in the Microsoft CRM\Server\bin\assembly folder.
    -I have the my callout dll, in this case I called it CalloutTest.dll in Microsoft CRM\Server\bin\assembly folder.
    -I have restarted iis.
    -Looked in the MSCRM registry for SetupMode key and it's not there. (Should I create it and set it to 0?).
    -There are no errors in the Event Viewer.
    -I have also restarted the server.

    About my callout:
    -I compiled it in VS 2003 so it's a .NET 1.1 assembly. This is because it was used in CRM 3.0.
    -I referenced the Microsoft.Crm.Platform.Callout.Base v.3.0.5300.0 from the CRM 4 install cd.
    -Here is the code:

    Code Snippet

    using System;
    using Microsoft.Crm.Callout;

    namespace CalloutTest
    {
        /// <summary>
        /// Summary description for MyCallout.
        /// </summary>
        public class MyCallout : CrmCalloutBase
        {
            public MyCallout()
            {
                //
                // TODO: Add constructor logic here
                //
            }

            public override void PostUpdate(CalloutUserContext userContext, CalloutEntityContext entityContext, string preImageEntityXml, string postImageEntityXml)
            {
                base.PostUpdate (userContext, entityContext, preImageEntityXml, postImageEntityXml);
            }

        }
    }



    -Here is the callout.config.xml

    Code Snippet

    <callout.config version="3.0" xmlns=" http://schemas.microsoft.com/crm/2006/callout/">
      <callout entity="new_testEntity" event="PostUpdate">
        <subscription assembly="CalloutTest.dll" class="CalloutTest.MyCallout">
          <postvalue>@all</postvalue>
        </subscription>
      </callout>
    </callout.config>



    Any ideas what could be the problem? Any other suggestions that may help resolve this error?

    Thanks in advance.

    G

    Thursday, February 14, 2008 1:22 PM

Answers

  • Hi,

    I have resolved the issue. The issue is that Microsoft.Crm.Platform.Callout.Base was not registered in the GAC. I thought the install would take care of these kinds of things right?

    No worries, I resolved it by using the gacutil to register the callout base assembly by executing the command below:
    C:\gacutil /i Microsoft.Crm.Platform.Callout.Base

    Thanks again for all the assistance! I will use the resources you've all provided where applicable.

    G
    Friday, February 15, 2008 2:54 PM

All replies

  •  

    Hi.

     

    The Callout you sent has no implementation.

    Do you still get the error popup if you use an empty callout like so:

     

    public override void PostUpdate(CalloutUserContext userContext, CalloutEntityContext entityContext, string preImageEntityXml, string postImageEntityXml)
    {
          // not implemented...

    }

     

    Adi

    Thursday, February 14, 2008 7:15 PM
  • Hi,

    Yes I did still get the error even with an empty method. I'm going to install VS on the server so that I can debug it.

    Could there be some security config. that I'm missing?

    Thanks in advance.
    Thursday, February 14, 2008 7:37 PM
  • I may be way off the mark here, so apologies if this is the case. 

     

    Do these call outs run under the website context?

     

    If so CRM 4 creates it's website and sets the .NET version to 2.0, you cannot run 1.1 under the same context.

     

    Could it be this causing problems? Are you in a postiion to compile your code for the 2.0 framework?

     

    Phil

     

    Thursday, February 14, 2008 7:53 PM
  • Hi,

    Thanks for all the replies.

    I compiled the code in vs2005 as well while still referencing the 3.0 web services. I did this on another machine and I was able to debug and step through the callout code. So, I moved this same dll over to the trouble server and I still received the same error.

    Thanks.
    Thursday, February 14, 2008 8:15 PM
  • Hi.

     

    Callouts are fully upgradeable except for a few deprecated classes, entities and massages.

    Check the SDK under upgrading Issues for callouts and workflow.

    You need to compile the code with vs2003 using framework 1.1.

     

    Cheers,

    Adi

     

    Thursday, February 14, 2008 9:19 PM
  • Dear here are few links will help you regarding callouts debug and use VS 2005 or build using .net framework 1.1

     

    As callouts should compile in framework 1.1, but you can also write using this way

     

    http://blogs.msdn.com/arash/archive/2006/08/25/719626.aspx

     

    How you can debug, see it plz.

     

    http://www.codeproject.com/KB/architecture/CRM_30_development.aspx

     

    hopefull it will help.

     

    Best Regards,

    Imran

     

    http://microsoftcrm3.blogspot.com

     

    Friday, February 15, 2008 5:55 AM
    Moderator
  • Hi,

    I have resolved the issue. The issue is that Microsoft.Crm.Platform.Callout.Base was not registered in the GAC. I thought the install would take care of these kinds of things right?

    No worries, I resolved it by using the gacutil to register the callout base assembly by executing the command below:
    C:\gacutil /i Microsoft.Crm.Platform.Callout.Base

    Thanks again for all the assistance! I will use the resources you've all provided where applicable.

    G
    Friday, February 15, 2008 2:54 PM
  •  Shawsky wrote:

    I may be way off the mark here, so apologies if this is the case. 

     

    Do these call outs run under the website context?

     

    If so CRM 4 creates it's website and sets the .NET version to 2.0, you cannot run 1.1 under the same context.

     

    Could it be this causing problems? Are you in a postiion to compile your code for the 2.0 framework?

     

    Phil

     

     

    I know this is an old thread, but anyway...

     

    My callout is built in .Net framework 1.1. Under MSCRM4 in IIS, my callout's ASP.Net version is 2.0. Is this the correct setting?

     

    Thanks in advance.

    Wednesday, April 23, 2008 10:44 AM
  •  biggo78 wrote:
    Hi,

    I have resolved the issue. The issue is that Microsoft.Crm.Platform.Callout.Base was not registered in the GAC. I thought the install would take care of these kinds of things right?

    No worries, I resolved it by using the gacutil to register the callout base assembly by executing the command below:
    C:\gacutil /i Microsoft.Crm.Platform.Callout.Base

    Thanks again for all the assistance! I will use the resources you've all provided where applicable.

    G

    Thank you for posting this, I was experiencing the exact same problem and adding the Microsoft.Crm.Platform.Callout.Base to GAC also solved the problem here!
    Wednesday, June 4, 2008 9:09 AM