TypeLoadException: Could not load type ‘type name’ from assembly ‘assembly name, Version=1.0.0.0, Culture=neutral, PublicKeyToken=…’

Posted: February 22, 2012 in BizTalk
Tags: ,

Recently I was testing a new BizTalk solution version with a couple of new features when I came across with the following error:

Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘MyService(4dfd3eeb-5cb2-9ca5-2e15-59dd321e72ed)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: b8b6c570-516c-4e40-a07a-96632f7e8506
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Could not load type ‘type name’ from assembly ‘assembly name, Version=1.0.0.0, Culture=neutral, PublicKeyToken=…’.
Exception type: TypeLoadException
Source: …
Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)

This error occurs after invoke the service or after dropping a file to the receive location.

CAUSE

  • You didn’t install the assembly specified in the error.
  • Your DLL depend on other DLL’s to get its job done and if you didn’t copy or install those too, you’d indeed get this error message.
  • Or you have installed an older version of the assembly.

This error occurs often when we use C# HelperClass to support the orchestrations, but can occur in other situations.

SOLUTION

Make sure that you have the last version of the assembly installed.

  • Rebuild the solution.
  • Deploy the correct solution.

Tags: BizTalk | Errors and Warnings, Causes and Solutions

Comments
  1. Marc says:

    Hi Sandro,

    thank you for your tireless work, It was of great help for me on several occasions.🙂

    Allow me an addition to your post from my everyday-work:
    When you do not work with different versions of a DLL, occasionally it happens that a DLL is not overwritten correctly in GAC during deployment.
    To counter this: Uninstall the DLL from GAC, make sure that it is not present any more and install the new version (maybe just using gacutil, because it has been registered correctly in MgmtDB during deployment).
    It might help to verify the current DLL in GAC using Reflector or a similar tool. E.g. if you want to check a map in Reflector, look for “XMLContent” where you can find the XML representation of the map.

    Best regards
    mipsen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s