English 中文(简体)
系统. reflection. RuntimeModule. GetTypes () 与 ODP. Net 和 C# 的错误
原标题:System.Reflection.RuntimeModule.GetTypes() error with ODP.Net and C#

我写了一个相当复杂的 C# 应用程序, 它通过 ODP. Net 访问一个神器数据库。 我将应用程序开发在一台窗口 XP 机器上( 32比特), 我在那里安装了 ODAC ( 32比特) 。 应用程序在开发个人电脑上运行时没有出现故障,但在服务器上丢出一个例外( 窗口服务器 2003 x64 服务包 2 ) 。

我安装了服务器上.Net框架4.0的运行时间(dotNetFx40_Full_x86_x64.exe),以及ODAC -- -- 我首先尝试了Windows x64的第4版(11.2.0.3.0),然后尝试了Oracle 开发者工具用于视觉工作室的第4版(11.2.0.3.0),然后尝试了Oracle 开发者工具的第4版(11.2.0.3.0)。

没有效果。 32 位版本稍有进展。 我第一次在数据库上拨打 LINQ 语句, 我收到以下信息 。

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()
   at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()
   at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.Load()
   at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)
   at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors)
   at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage)
   at System.Data.Metadata.Edm.ObjectItemCollection.ImplicitLoadAssemblyForType(Type type, EdmItemCollection edmItemCollection)
   at System.Data.Metadata.Edm.MetadataWorkspace.ImplicitLoadAssemblyForType(Type type, Assembly callingAssembly)
   at System.Data.Objects.ObjectContext.GetTypeUsage(Type entityCLRType)
   at System.Data.Objects.ObjectContext.GetEntitySetForNameAndType(String entitySetName, Type entityCLRType, String exceptionParameterName)
   at System.Data.Objects.ObjectContext.CreateObjectSet[TEntity](String entitySetName)
   at MyProgram.Data.DT.DTContext3.get_MYTABLE()

64位版本显示我没有 Oracle. Access 支持, 与我第一次尝试在服务器上不使用 IDAC 运行应用程序时得到的错误信息相同 。

有人能帮我吗?我看过一些讨论类似问题的条目,我所看到的唯一令人信服的回答是 建立可执行文件的复制版本地集到 TRUE, 供所有引用, 但甚至都失败了。 我仍然收到相同的错误信息 。

问题回答

我刚刚自己找到答案。这个代码,一个由bgripka输入的条目,我在讨论这个问题时发现了这个条目,给了我答案。其中提到了一个缺失的图书馆(根本不需要图书馆 ) 。

    catch (ReflectionTypeLoadException ex)
    {
        StringBuilder sb = new StringBuilder();
        foreach (Exception exSub in ex.LoaderExceptions)
        {
            sb.AppendLine(exSub.Message);
            if (exSub is FileNotFoundException)
            {
                FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
                if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
                {
                    sb.AppendLine("Fusion Log:");
                    sb.AppendLine(exFileNotFound.FusionLog);
                }
            }
            sb.AppendLine();
        }
        string errorMessage = sb.ToString();
        log.Fatal(errorMessage);
    }




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签