Revit cannot run external application

Revit cannot run external application

Anonymous
Not applicable
3,450 Views
2 Replies
Message 1 of 3

Revit cannot run external application

Anonymous
Not applicable

Revit 2019 gives this message with System.TypeLoadException whenever Revit loads.  The external application is one that I provided by a .dll.  I made sure that the dll and the ones it references were all created using .NET framework 4.7.1 but the problem still occurs.  The details of the assembly in the message look correct.   If I remove the dll from the folder I get a message saying the assembly does not exist.   Is there any way to get more information about what is causing the System.TypeLoadException problem.  Any suggestions for things to try?  I have run out of ideas.

0 Likes
Accepted solutions (1)
3,451 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

Need to use AppDomain.CurrentDomain.AssemblyResolve event if referenced dll files are not where Revit.exe is (and it would be bad practice to put them where Revit.exe is):

 

http://thebuildingcoder.typepad.com/blog/2014/05/rvtva3c-assembly-resolver.html

0 Likes
Message 3 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous,

I think there are some problems with your .addin manifest file

1)Check whether you gave proper class name.For example

namespace REVITAPPLICATION
{
    [Transaction(TransactionMode.Manual)]
    public class Class1 : IExternalApplication
    

then the FullClassName should be 

<FullClassName>REVITAPPLICATION.Class1</FullClassName>

2)Since you created application,in the Addin manifest file the ADDIN type should be application

     <AddIn Type="Application">


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network