Thursday, August 16, 2012 6:34 PM
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.
- Edited by Nagarajan Amarnath Thursday, August 16, 2012 7:56 PM
Thursday, August 16, 2012 8:51 PMI think you are using a 32 bit version of the CRM sdk dll when it should be 64 bit....or vice versa. Typically that is the reason for an BadImageFormatException
- Proposed As Answer by Sam - InogicMVP Thursday, August 16, 2012 9:16 PM
Friday, August 17, 2012 4:26 PM
Which dll you are referring to ? I have only referred Microsoft.Crm.Platform.Callout.Base.dll in my VS 2005 project.
Friday, August 17, 2012 5:23 PM
Are you using .Net 2.0? It might have to be set to .Net 1.1 to use that dll
Friday, August 17, 2012 5:53 PMRight, i use .Net 2.0, but unfortunately i cannot find a download for .Net 1.1 to install in my system.
Friday, August 17, 2012 6:00 PM
Friday, August 17, 2012 6:47 PMWhen i run the MSBee setup, it says it needs .Net framework 1.1 SDK which is again not available for download.