Using Fody package, Autodesk Revit Plugin project don't load commands by AddinManager

Using Fody package, Autodesk Revit Plugin project don't load commands by AddinManager

Anonymous
Not applicable
1,170 Views
5 Replies
Message 1 of 6

Using Fody package, Autodesk Revit Plugin project don't load commands by AddinManager

Anonymous
Not applicable
0 Likes
Accepted solutions (2)
1,171 Views
5 Replies
Replies (5)
Message 2 of 6

jeremy_tammik
Alumni
Alumni

I looked at your GitHub issue and have no idea whatsoever what you are talking about there.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 6

ricaun
Advisor
Advisor
Accepted solution

The AddinManager does not know you have others embedded dll inside the main dll, probably did not find the IExternalCommand on the main dll, you probably using some framework.

 

Usually, you need to add this before reading the Commands:

AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

This makes the AppDomain load the Assembly embedded when not found. On the Costura case Costura.Template

 

I don't know if is possible to do something like this using the AddinManager plugin.

 

You could disable Costura when using AddinManager.

 

or

 

You could try, ricaun.Console. I add a feature to make it possible to load all the Costura embedded assembly before loading the IExternalCommand / IExternalApplication.

 

I always use Costura on my plugins, sometimes is a little trick to make work with Revit.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 4 of 6

Anonymous
Not applicable

My understanding is that the Revit plug-in manager needs to be updated to solve the problem of embedded assemblies and to support the operation of various merged assemblies.

0 Likes
Message 5 of 6

Anonymous
Not applicable

In that issue, someone said to use skip assembly to merge. In my opinion, this is meaningless at least in the current project, because I don’t have too many assemblies, just don’t support the embedding of core classes, such as, IExternalCommand’s extended class.

 

Revit may require special pre-loading and active intervention. I don’t know how you can load the embedded assembly, how to load it successfully, it should be successful, because I’m in Before running this, I ran another plug-in first, which loaded the dll into it, and I successfully made the embedded assembly plug-in run successfully.

 

You fully understand what I mean. Your plugin is pretty good and will help you promote it. From what you mean, it seems that the embedded assembly is handled internally, which is great. If the Revit official can learn from your plan, it will help more people.

0 Likes
Message 6 of 6

ricaun
Advisor
Advisor
Accepted solution

Is not an issue, you are not supposed to execute anything when reading a dll that's what you need to load the Costura embedded assemblies.

 

The AddinManager probably searching for some class with the IExternalCommand and IExternalApplication.

 

ricaun.Console is doing something like that but before doing the search I execute the method below:

 

public class Program
{
    public static void Main()
    {
        ILTemplate.Attach();
    }
}

This makes sure all the Costura embedded assemblies gonna be loaded on the AssemblyResolve before searching.

 

I was looking at the ILRepack package that's really embedded the dlls but I found really complex to set up.

 

This template was using but I guess the last version does not support it anymore.

 

 

AddinManager was designed in 2010, that's what the help says... Unfortunately is close-source and the community can not contribute to the project.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils