在 ASP.NET 应用程序中,我试图从存储在 bin 子文件夹中的不同程序集执行 AppDomain 中的方法。我正在创建 AppDomain 并调用 AppDomain.CreateInstanceAndUnwrap。它在我的计算机和 Windows Server 2K8 上运行良好,但在 Windows Server 2k3 上抛出异常:
在 System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName) 在 System.AppDomain.CreateInstance(String assemblyName, String typeName) 在 System.Activator.CreateInstance(String assemblyName, String typeName) 在 System.Activator.CreateInstance(String assemblyName, String System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) ) 在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean for Introspection,Boolean suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) 在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase , 证据 assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean suppressSecurityChecks)Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean for Introspection, Boolean suppressSecurityChecks)
System.IO.FileLoadException:无法加载文件或程序集“MyAssembly”或其依赖项之一。API 调用异常退出。(来自 HRESULT 的异常:0x800300FA (STG_E_ABNORMALAPIEXIT)) System.IO.FileLoadException:无法加载文件或程序集“MyAssembly,版本=2.23.7.23064,Culture=neutral,PublicKeyToken=null”或其依赖项之一。API 调用异常退出。(来自 HRESULT 的异常:0x800300FA (STG_E_ABNORMALAPIEXIT))
有人知道为什么吗?