我收到有关程序集“C:\ Ora10g \ bin \ Zip.exe”的错误。问题是这个解决方案根本不会在Oracle中使用任何东西。我无法在项目的任何地方找到10g的单一引用。我从另一个离开我们小组的人那里继承了这个。他从未遇到过这个问题。我团队的另一名成员说他之前得到了这个,但重新安装10g的客户端部分修复了它。那里没有这样的运气。我甚至尝试使用WinGrep在整个解决方案文件夹中搜索“Ora10g”,但它不存在。
有什么想法吗?在我弄清楚如何摆脱对Oracle的这种错误引用之前,我无法构建这个解决方案。
VS 2005解决方案。包含几个WinForm应用程序,几个类库和一个Web服务。该错误发生在主类库项目中。
以下是错误消息:
Error 1 The "ResolveAssemblyReference" task failed unexpectedly.
System.BadImageFormatException: Could not load file or assembly 'C:\Ora10g\bin\Zip.exe' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'C:\Ora10g\bin\Zip.exe'
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Microsoft.Build.Shared.AssemblyNameExtension.GetAssemblyNameEx(String path)
at Microsoft.Build.Tasks.SystemState.GetAssemblyName(String path)
at Microsoft.Build.Tasks.Resolver.FileMatchesAssemblyName(AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, Boolean allowMismatchBetweenFusionNameAndFileName, String pathToCandidateAssembly, ResolutionSearchLocation searchLocation)
at Microsoft.Build.Tasks.Resolver.ResolveAsFile(String fullPath, AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, Boolean allowMismatchBetweenFusionNameAndFileName, ArrayList assembliesConsideredAndRejected)
at Microsoft.Build.Tasks.Resolver.ResolveFromDirectory(AssemblyNameExtension assemblyName, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String directory, ArrayList assembliesConsideredAndRejected)
at Microsoft.Build.Tasks.AssemblyFoldersResolver.Resolve(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& foundPath, Boolean& userRequestedSpecificFile)
at Microsoft.Build.Tasks.AssemblyResolution.ResolveReference(IEnumerable`1 jaggedResolvers, AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& resolvedSearchPath, Boolean& userRequestedSpecificFile)
at Microsoft.Build.Tasks.ReferenceTable.ResolveReference(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Reference reference)
at Microsoft.Build.Tasks.ReferenceTable.ResolveAssemblyFilenames()
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure()
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()
at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
答案 0 :(得分:4)
赠送的是“模块应该包含一个程序集清单”,并且该异常的类型为System.BadImageFormatException
。有些东西试图加载文件“C:\ Ora10g \ bin \ Zip.exe”,好像它是一个.net程序集,它可以:
有你:
%windir%\Microsoft.NET\Framework\v2.0.50727
您可以尝试的其他事项:
答案 1 :(得分:0)
重新安装Oracle客户端时,您将它放在哪里?如果您使用了安装程序中的默认位置,则ORACLE_HOME将不在c:\ ora10g中。目录c:\ ora10g \ bin是否存在?
可能的解决方法是创建目录c:\ ora10g \ bin,然后从那里的ORACLE_HOME \ bin目录中复制zip.exe文件。您的项目中显然有一些内容在该特定位置引用了Oracle zip二进制文件(无法帮助您)。
答案 2 :(得分:0)
此引用的程序集之一可能会引用此文件,从而导致间接依赖。
检查文件是否存在于目录中,如果存在,请确保该文件也存在于构建服务器中。
答案 3 :(得分:0)
另外,请确保没有更改任何官方Targets文件。这些会在您的构建环境中自动导入。也许你也可以对它们做一个grep?
更具体地说,你的前任可以修改它们,以便在他的所有项目中包含某种构建步骤。
答案 4 :(得分:0)
您的应用程序是否实际位于c:\ ora10g目录中?如果是这样的话.Net会尝试加载\ bin目录中的每个程序集,无论你是否实际引用它。