chuongmep / RevitAddInManager

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

Could not load file or assembly ... or one of its dependencies. The parameter is incorrect #10

Closed chuongmep closed 1 year ago

chuongmep commented 2 years ago

Describe the bug Could not load file or assembly 'RoslynPad.Roslyn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image image

Desktop (please complete the following information):

chuongmep commented 2 years ago

the problem has been temporarily fixed but still happens at some point in time, needs further investigation to fully resolve

syncltu commented 2 years ago

Good day. Thanks for Your contribution to the community. Is it only me or i.e. Automapper or Autofac container nuget packages does not load as well and throws "Could not load file or assembly. The located assembly's manifest definition does not match the assembly reference.". If you launch through Revit panel interface, it works without problems. When you launch addin manager tool, it crashes.

chuongmep commented 2 years ago

@syncltu you have any github project sample to i can create again this pepblem ?

syncltu commented 2 years ago

Well, I tried to create a small sample project, and guess what... It worked! Then on the original project that I was having issues, I cleared all cache, deleted all folders from temp that Addin Manager generates and it also magically worked. I guess the problem will occur once again anytime soon, but at the meantime I cannot reproduce the issue. Probably there is something wrong with my project, not with Addin Manager itself. Sorry for bothering

chuongmep commented 2 years ago

No problem, if issue still happen please report again , hope can help to project become better 😉

SonaBIMDev commented 2 years ago

Hi, Does the pb is still here? I'm try to explain my pb : I create 2 projects into a solution. One HelloWorld with an ExternalCommand. Into the other, just a simple class to show a Dialog So, In HellWorld project, i've got the Display reference added When I compile, and putting two dlls and loading them threw .addin in Revit, it works But, When I Load with AIM, I've got an error. Do you know what? screenshot_181

chuongmep commented 2 years ago

Hi @pierrenavarra, You have any project demo sample like this in GitHub ?

SonaBIMDev commented 2 years ago

Hi @chuongmep

Thx for answering me. For exemple, I've followed Marko Koljancic's tutorial You can download this sample demo : I've got an error in AIM when I try to use ess_routing project But, if I transpose all function I wrote in ess_routing.core project into ess_routing project, it works.... It's strange... Have a look into this vidéo... ess_routing.zip

syncltu commented 2 years ago

@pierrenavarra Hello, Im having the same issue from time to time. What you can do is to debug and find which package it fails to load. For me it usually was failing to load nuget packages. What usually helps for me:

  1. Start command through revit interface, button and then in the same revit session opening it through addin manager.
  2. Deleting all folders that are created in "temp" data of user folder. These are created when addin manager is launched
SonaBIMDev commented 2 years ago

thx answering @syncltu

  1. I do that : start command through revit and through AIM in the same sessions.
  2. I've allready deleting temp directory of AIM I do not have packages....
chuongmep commented 2 years ago

@pierrenavarra please upload a project demo on github, I will review detail for you.

SonaBIMDev commented 2 years ago

Hi @chuongmep I've posted a ess_routing.zip into my precedent post...https://github.com/chuongmep/RevitAddInManager/issues/10#issuecomment-1191555222 You can see what I do into the vidéo linked also

chuongmep commented 2 years ago

Let me check for you.

SonaBIMDev commented 2 years ago

@chuongmep : thx

SonaBIMDev commented 2 years ago

Hi @chuongmep Do you have news for me :-)

chuongmep commented 2 years ago

Hi @chuongmep Do you have news for me :-) Hi @pierrenavarra, still not yet, I'm in still in process receive new job so busy. I will review when I have computer.

SonaBIMDev commented 2 years ago

Hi @chuongmep Thx no panic!

chuongmep commented 2 years ago

Tested but can't create again this error. @pierrenavarra,

syncltu commented 2 years ago

Some more insights. If visual studio solution contains of multiple projects, it tends to fail to load some of the nuget packages whenever you rebuild without closing. One thing that helped me is making a variable assembly version, what it means is that whenever you build, your assemblies version increments by 1 everytime. Because of this, addin manager loads newer assemblies without a problem. Take a look if it helps image Note that shared assembly info is a linked file and is the same for multiple projects. When you build a release you can create a normal version however you want, 1.0.0 or whatever. * symbol makes it variable. @pierrenavarra @chuongmep

syncltu commented 2 years ago

For all my colleagues and me this fixed the issue, should help you hopefully

SonaBIMDev commented 2 years ago

Tested but can't create again this error. @pierrenavarra,

Oh, thx @chuongmep