Error in callout (ISV code threw exception)

Proposed Answer Error in callout (ISV code threw exception)

  • Thursday, August 16, 2012 6:34 PM
     
     

    Hi,

    Wrote a simple callout with "PostCreate" method. Seems there is some problem calling the callout. I use CRM 3.0

    Also, is it mandatory to develop callout using VS.Net 2003 ? I use VS 2005.

    Please find error from eventlog and let me know what am i missing:

    ---------------------------------

    Error: ISV code threw exception: assembly: Sample.dll; class: MyNamespace.Sample; entity: cmp_institutions, event: postcreate, exception: System.BadImageFormatException: The format of the file 'Sample.dll' is invalid.
    File name: "Sample.dll"
       at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
       at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
       at Microsoft.Crm.Callout.CalloutHost.PostCreate(CalloutUserContext userContext, CalloutEntityContext entityContext)

    === Pre-bind state information ===
    LOG: Where-ref bind. Location = C:\Program Files\Microsoft CRM\server\bin\assembly\Sample.dll
    LOG: Appbase = c:\windows\system32\inetsrv\
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).
    ===

    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Program Files/Microsoft CRM/server/bin/assembly/Sample.dll.


    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    -----------------------------------


All Replies