Custom API Invocations crash Email Agent with a BadImageFormatException (Article # 335)
View products that this article applies to.
Problem:
When using Email Agent's API Invoke mode an attempt to invoke a custom API that resides in a .Net 2.0 assembly (e.g. built using Visual Studio 2005 or above) on Email Agent versions prior to 1.1 will result in Email Agent stopping unexpectedly.
An administrative email is sent containing exception details regarding the exception type: System.BadImageFormatException with a message saying "The format of the file 'AssemblyName' is invalid."
This situation occurs when the Email Agent service is using the .Net 1.1 runtime and you attempt to invoke a custom API written for the .Net 2.0 framework. It is not possible to load .Net 2.0 assemblies in an application running on the .Net 1.1 runtime.
Resolution:
You can force the Email Agent service to run using the .Net 2.0 runtime by adding the following to the application configuraiton file. This file is named {application name}.exe.config.
<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v1.1.4322" />
</startup>
Please see this blog post for more details on invoking custom APIs using Email Agent.
http://blogs.dovetailsoftware.com/blogs/gsherman/archive/2007/03/20/extending-superemailclerk-net-to-call-your-own-apis.aspx
Resolution:
Upgrade to a version of Email Agent 1.1 or newer which runs on the .Net 2.0 framework.
Applies To:
-
Email Agent – Dovetail Email Agent (formerly Super EmailClerk.NET)