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

Posted: February 22, 2012  |  Categories: Administration BizTalk

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 invoking 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.
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

  • Marc

    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

    • Thanks Marc for additional information, very useful. Feel free to post additional information anytime! 🙂

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top