I have had couple of emails in recent past with different third party developers providing me with their Revit add-in samples, where they are stuck because of the following System.TypeLoadException.
As mentioned here, the reason for this exception typically is that CLR did not find the assembly, or the type within the assembly or could not load the type. This in most cases that I have seen with Revit add-ins seems to commonly due to a mismatch between the .NET framework and the Revit version being used to develop the add-in. There are also couple of discussions on this topic in the Revit API discussion forum.
In the recent case, I had spent quite sometime confirming that the correct for the .NET framework was being targeted for in the VS project, the version of the Revit API references, and other settings and even double checked that entries in the .addin manifest file – all of which seemed perfect. Next, I started reading through the VB.NET code and immediately saw Namespace was provided in the code as well as in the Root Namespace field in the VB.NET project settings. Once I removed the Namespace entry from the code, the Add-in loaded up just fine in Revit. This would be a typical case whenever we end up converting C# code to VB.NET. Something to watch out for!