我得到当我打电话GetExportedTypes,代码抛出MissingMethodException抛出:MissingMethodException通过GetExportedTypes
Assembly.LoadFrom(assemblyPath).GetExportedTypes();
异常(名称混淆):
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:
异常没有内部异常或其他细节值得一提。
这是什么原因造成的?我该如何解决它?
反射器具有没有问题加载该组件:
- 它注册在GAC
- 只引用MSCORLIB。
- 我没有构建程序集 - 在我的机器上只有1个版本的程序集。
更新:
有问题的组件,似乎是一个装配使用Tlbexp.exe内置 - 这很可能是这是使某种差异。
如果可能,你可以提供整个堆栈跟踪吗? – leppie 2010-08-18 04:48:15