- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我调用 GetExportedTypes 时,我得到了一个 MissingMethodException,代码:
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:
最佳答案
据我所知,只是预期某些程序集会抛出此异常 - GetTypes
方法抛出类似的异常 - ReflectionTypeLoadException ,但是这个异常也有 Types属性似乎是已成功加载的类型列表。
现在我已经修改了我的代码,以便它调用此方法并捕获生成的异常:
try
(
return assembly.GetTypes();
)
catch (ReflectionTypeLoadException ex)
{
return ex.Types;
}
关于.net - GetExportedTypes 抛出的 MissingMethodException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3509009/
当我调用 GetExportedTypes 时,我得到了一个 MissingMethodException,代码: Assembly.LoadFrom(assemblyPath).GetExporte
如果我运行这段代码: var myAsm = typeof(MyType).Assembly; var types = myAsm.GetExportedTypes(); 我得到: System.IO
我的任务:在 dll 或 exe 文件中查找所有窗体(WindowsForm 或 WPF,无关紧要)并返回该列表。理论上可行(意思是:如果我有一个带有 WPF 或 WindowsForm 的程序集,我
Assembly.GetExportedTypes() 有什么作用?它与 Assembly.GetTypes() 有何不同 能举例说明吗? 最佳答案 GetExportedTypes() 不包括 pr
我想使用反射分析程序集。 具体来说,我想知道某个接口(interface)是否在程序集中的某个类型中实现。 尽管并非所有程序集引用都出现在机器上,这就是我需要分析它们的原因。 因此,当我调用 GetT
我在将 Windows Phone 7.5 类库加载到 WP 单元测试框架时遇到了一些严重的问题。它在内部调用我的程序集上的 GetExportedTypes(),这会抛出不包含任何详细信息的 Ref
.NET Assembly 类包含一个方法 ( GetExportedTypes ()) 和一个属性 ( ExportedTypes)。 这些文档看起来是相同的(“返回程序集中所有公共(public)
我对您将使用其中一个或另一个的场景感到困惑。 如果您有一个包含一些公共(public)和私有(private)(或内部)类型的程序集,那么只有公共(public)类型可以从外部使用。任何内部类型或私有
我正在尝试让一些插件在 asp.net mvc 中工作。我的插件 DLL 有一个 Controller 以及一个描述符/模块类。 Controller 签名如下所示: [Export("SomeCon
简介 我正在尝试加载一些程序集并从中获取类型...程序集的路径是 bin/Plugin1 我也在尝试为他们创建一个应用程序域并将它们加载到那里。基本步骤是: 1。创建域: domain = AppDo
我是一名优秀的程序员,十分优秀!