chuongmep / RevitAddInManager

Revit AddinManager update .NET assemblies without restart Revit for developer.
MIT License
275 stars 50 forks source link

Using AIM with External dependencies #37

Closed pierrenavarra closed 1 year ago

pierrenavarra commented 1 year ago

Hi @chuongmep I've got a Visual Studio project wich has External Dependencies like DevisId.dll of Standard.Licensing wich permits me to manage licenses. When I call my AddIn.dll, it do not works. What's the pb? Do I nid to Merge dependencies in my AddIn.dll?

I've noticed that when I run Revit and click on my button loading via fil.addin, it works and after I can call my plugin via AIM (F6), strange do'nt you think?

chuongmep commented 1 year ago

@pierrenavarra I still don't understand what you mean, do you mean ask to merge assembly ? Revit AddinManager doesn't need to do that because it load order assembly.

pierrenavarra commented 1 year ago

Ok, sorry, I'm not clear...this is not easy to explain the pb. So I put here a Video. You'll see that I'm using 2 external references called DeviceId.dll and Standard.Licensing.dll I've got 2 directories : on in C:\ProgramData\Autodesk\Revit\Addins\2018\Debug for the AIM and on called C:\ProgramData\Autodesk\Revit\Addins\2018\RoutingManager loaded via the addin file. After loading Revit, if I click via AIM on my plugin and calling the code wich call my License.cs, I've got a crash. So, I reload Revit, I first click on my button and click on Btn_LIcense, it works, and, in the same session, if I run my plugIn via the AIM, now, it works... Strange not? https://youtu.be/vPz4GLH0O4w

chuongmep commented 1 year ago

Hi @pierrenavarra, thanks for your patience. I have a recommend for you, let try clone open project Revit Addin manager, and next click to debug with selection version Revit, it will show for you line code error in project Revit Addin Manager and I will look to it to see reason why it can't load assembly dependent in your case : Some step like:

chuongmep commented 1 year ago

This problem can resolve by this way : Defind again assembly config with assembly project External Dependencies

<PropertyGroup>
<AssemblyVersion>1.0.1.*</AssemblyVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Deterministic>false</Deterministic>
</PropertyGroup>
chuongmep commented 1 year ago

This add-in not is for all (Learning is main propose of this add-in), when you works with many case with External Dependencies , I recomend let use debug mode.