I'm getting a MissingMethodException thrown when I call GetExportedTypes, the code:
Assembly.LoadFrom(assemblyPath).GetExportedTypes();
The exception (names obfuscated):
System.MissingMethodException was unhandled
Message="Method not found: 'Void Namespace.IMyMethod.MyMethod(UInt32, Namespace.IMyOtherMethod ByRef, UInt32 ByRef)'."
Source="mscorlib"
StackTrace:
at System.Reflection.Assembly._GetExportedTypes()
at System.Reflection.Assembly.GetExportedTypes()
at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settings\jpealing\My Documents\Visual Studio 2008\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 16
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
The exception has no inner exception or other details worth mentioning.
What causes this? How can I fix it?
Reflector has no problems loading this assembly:
- It is registered in the GAC
- It only references mscorlib.
- I didn't build the assembly - there is only 1 version of this assembly on my machine.
Update:
The assembly in question appears to be an assembly built using Tlbexp.exe - it seems likely that this is making some sort of difference.