简体   繁体   中英

MissingMethodException when calling to a class library from third-party application

I'm getting a MissingMethodException (referencing a specific method) when calling a method in a company library from a third-party application with scripting, OnBase. The object the method is called on already exists and succeeds other calls before this point.

Things I've confirmed:

  • Other references from this library work correctly
  • Method is public
  • Version of DLL referenced by the script in question has the method (rebuilt the assembly and re-imported it, outputs show current date as created date, and OnBase shows the correct updated version number)
  • No versions of the DLL are in the GAC
  • Server application has been restarted since importing

Also of note is that the script editor's code completion in OnBase can't find the method either, but it also succeeds building.

  • What are the more uncommon locations where I should be looking for an old DLL?
  • Are there any OnBase specific locations?
  • What other causes can there be?

To clarify, assembly 1 is referenced by the script and contains the method that's coming back missing, and assembly 2 is referenced by assembly 1 and the script both. Assembly 2 works in all cases, assembly 1 works except this one method.

The reason this was happening was that assembly 1 and the script were referencing different versions of assembly 2, so when we were trying to pass in an object defined in assembly 2 to the method in assembly 1, it was from a version that didn't match and so what was missing was a method with that specific signature, ie DoStuff(v1.Foo) existed but DoStuff(v2.Foo) didn't. Obviously, the error only stated that DoStuff(Foo) was missing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM