RevitAddInManager icon indicating copy to clipboard operation
RevitAddInManager copied to clipboard

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

Open chuongmep opened this issue 3 years ago • 21 comments

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))

  • Problem cause when we load a dll depend on multiple assembly other.

To Reproduce Steps to reproduce the behavior:

  • Load Assembly using reference to other assembly
  • Run to see error

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

Screenshots image image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser [e.g. chrome, safari]
  • Version Revit 2022 Additional context Add any other context about the problem here.

chuongmep avatar Jan 26 '22 08:01 chuongmep

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

chuongmep avatar Jan 31 '22 02:01 chuongmep

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.

syncltu avatar May 28 '22 14:05 syncltu

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

chuongmep avatar May 28 '22 14:05 chuongmep

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

syncltu avatar May 28 '22 15:05 syncltu

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

chuongmep avatar May 28 '22 15:05 chuongmep

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

SonaBIMDev avatar Jul 20 '22 14:07 SonaBIMDev

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

chuongmep avatar Jul 21 '22 00:07 chuongmep

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

SonaBIMDev avatar Jul 21 '22 14:07 SonaBIMDev

@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

syncltu avatar Jul 21 '22 19:07 syncltu

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....

SonaBIMDev avatar Jul 22 '22 06:07 SonaBIMDev

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

chuongmep avatar Jul 22 '22 06:07 chuongmep

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

SonaBIMDev avatar Jul 22 '22 06:07 SonaBIMDev

Let me check for you.

chuongmep avatar Jul 22 '22 06:07 chuongmep

@chuongmep : thx

SonaBIMDev avatar Jul 22 '22 06:07 SonaBIMDev

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

SonaBIMDev avatar Jul 25 '22 06:07 SonaBIMDev

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.

chuongmep avatar Jul 25 '22 07:07 chuongmep

Hi @chuongmep Thx no panic!

SonaBIMDev avatar Jul 25 '22 08:07 SonaBIMDev

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

chuongmep avatar Aug 24 '22 13:08 chuongmep

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 avatar Aug 24 '22 19:08 syncltu

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

syncltu avatar Aug 24 '22 19:08 syncltu

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

Oh, thx @chuongmep

SonaBIMDev avatar Aug 25 '22 07:08 SonaBIMDev