332 instantiations of BadImageFormatException
ILCompiler.Build.Tasks (3)
DumpNativeResources.cs (3)
149throw new BadImageFormatException(); 166throw new BadImageFormatException(); 172throw new BadImageFormatException();
ILCompiler.Compiler (2)
Compiler\DependencyAnalysis\ResourceDataNode.cs (1)
106throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
213throw new BadImageFormatException(ex.Message, filePath);
ILCompiler.MetadataTransform (5)
ILCompiler\Metadata\Transform.Constant.cs (1)
54throw new BadImageFormatException();
ILCompiler\Metadata\Transform.Type.cs (1)
521throw new BadImageFormatException();
ILCompiler\Metadata\Transform.TypeForwarders.cs (1)
93throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (2)
20throw new BadImageFormatException(); 259throw new BadImageFormatException();
ILCompiler.ReadyToRun (7)
Compiler\DependencyAnalysis\ReadyToRun\CopiedFieldRvaNode.cs (1)
115throw new BadImageFormatException();
Compiler\DependencyAnalysis\ReadyToRun\DebugInfoTableNode.cs (1)
310throw new BadImageFormatException("Unexpected var loc type");
Compiler\DependencyAnalysis\ReadyToRun\ModuleTokenResolver.cs (3)
201throw new BadImageFormatException(); 223throw new BadImageFormatException(); 266throw new BadImageFormatException();
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\PEReaderExtensions.cs (1)
144throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
213throw new BadImageFormatException(ex.Message, filePath);
ILCompiler.RyuJit (1)
JitInterface\CorInfoImpl.RyuJit.cs (1)
1222throw new BadImageFormatException();
ILCompiler.TypeSystem (16)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataVirtualMethodAlgorithm.cs (1)
185throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemContext.cs (1)
645throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\CustomAttributeTypeProvider.cs (1)
83throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaField.cs (1)
337throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaSignatureParser.cs (7)
85throw new BadImageFormatException("Type expected"); 231throw new BadImageFormatException(); 471throw new BadImageFormatException(); 502throw new BadImageFormatException(); 521throw new BadImageFormatException(); 557throw new BadImageFormatException(); 562throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaSignatureTranslator.cs (3)
67throw new BadImageFormatException(); 88throw new BadImageFormatException(); 102throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\PrimitiveTypeProvider.cs (1)
72throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\MethodDesc.Interop.cs (1)
150_ => throw new BadImageFormatException()
Microsoft.Build.Tasks.Core (5)
AssemblyDependency\AssemblyInformation.cs (1)
534throw new BadImageFormatException(string.Format(CultureInfo.CurrentCulture,
AssemblyDependency\ReferenceTable.cs (1)
2885throw new BadImageFormatException(ResourceUtilities.GetResourceString("ResolveAssemblyReference.ImplementationDllHasInvalidPEHeader"));
ManifestUtil\Manifest.cs (1)
583BadImageFormatException exception = new BadImageFormatException(null, a.ResolvedPath);
ManifestUtil\ManifestReader.cs (1)
69throw new BadImageFormatException(null, path);
ManifestUtil\TrustInfo.cs (1)
719throw new BadImageFormatException();
Microsoft.CodeAnalysis (16)
MetadataReader\MetadataDecoder.cs (5)
557throw new BadImageFormatException(); 571throw new BadImageFormatException(); 581throw new BadImageFormatException(); 1749throw new BadImageFormatException(); 1755throw new BadImageFormatException();
MetadataReader\MetadataReaderExtensions.cs (5)
106throw new BadImageFormatException(string.Format(CodeAnalysisResources.InvalidAssemblyName, nameStr)); 112throw new BadImageFormatException(string.Format(CodeAnalysisResources.InvalidCultureName, cultureName)); 125throw new BadImageFormatException(CodeAnalysisResources.InvalidPublicKey); 133throw new BadImageFormatException(CodeAnalysisResources.InvalidPublicKeyToken); 146throw new BadImageFormatException(CodeAnalysisResources.InvalidPublicKey);
MetadataReader\PEModule.cs (2)
263throw new BadImageFormatException(CodeAnalysisResources.PEImageDoesntContainManagedMetadata); 396throw new BadImageFormatException(string.Format(CodeAnalysisResources.InvalidModuleName, this.Name, moduleName));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (4)
887throw new BadImageFormatException(); 917var name = ReadNullTerminatedString(ref blobReader) ?? throw new BadImageFormatException(); 918var value = ReadNullTerminatedString(ref blobReader) ?? throw new BadImageFormatException(); 923throw new BadImageFormatException();
Microsoft.CodeAnalysis.Features (4)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (4)
887throw new BadImageFormatException(); 917var name = ReadNullTerminatedString(ref blobReader) ?? throw new BadImageFormatException(); 918var value = ReadNullTerminatedString(ref blobReader) ?? throw new BadImageFormatException(); 923throw new BadImageFormatException();
Microsoft.Diagnostics.DataContractReader.Contracts (23)
Contracts\GCInfo\X86\GCArgTable.cs (3)
190throw new BadImageFormatException($"Unexpected special code {val}"); 241_ => throw new BadImageFormatException("Invalid this-pointer register encoding"), 507throw new BadImageFormatException("Invalid GC encoding");
Contracts\GCInfo\X86\InfoHdr.cs (3)
290throw new BadImageFormatException("Unexpected gcinfo header encoding"); 294throw new BadImageFormatException("Unexpected gcinfo header encoding"); 328throw new BadImageFormatException("Unexpected gcinfo header encoding");
Contracts\Signature\RuntimeSignatureDecoder.cs (6)
125throw new BadImageFormatException($"Unexpected signature type code: 0x{typeCode:X2}"); 137throw new BadImageFormatException("Signature type sequence must have at least one element"); 296throw new BadImageFormatException("TypeSpecification handle not allowed in this context"); 302throw new BadImageFormatException("Expected TypeDef, TypeRef, or TypeSpec handle"); 314throw new BadImageFormatException($"Expected signature header {expectedKind}, got {header.Kind} (raw 0x{header.RawValue:X2})"); 323throw new BadImageFormatException($"Expected Method or Property signature header, got {kind} (raw 0x{header.RawValue:X2})");
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\NativeReader.cs (11)
199throw new System.BadImageFormatException("offset out of bounds"); 212throw new System.BadImageFormatException("offset out of bounds"); 221throw new System.BadImageFormatException("offset out of bounds"); 231throw new System.BadImageFormatException("offset out of bounds"); 246throw new System.BadImageFormatException("DecodeUnsigned"); 258throw new System.BadImageFormatException("offset out of bounds"); 271throw new System.BadImageFormatException("offset out of bounds"); 280throw new System.BadImageFormatException("offset out of bounds"); 290throw new System.BadImageFormatException("offset out of bounds"); 305throw new System.BadImageFormatException("DecodeSigned"); 396throw new BadImageFormatException("Unexpected end of image while reading ULEB128");
Microsoft.Diagnostics.DataContractReader.Legacy (4)
HeaderReaderHelpers.cs (2)
33throw new BadImageFormatException("Invalid IL method header."); 44throw new BadImageFormatException("Invalid IL method header.");
MethodSignatureHelpers.cs (1)
24throw new BadImageFormatException();
SOSDacImpl.cs (1)
1155throw new BadImageFormatException();
Microsoft.NET.HostModel (1)
ComHost\ClsidMap.cs (1)
296throw new BadImageFormatException("Unexpectedly got an enum parameter for an attribute.");
Mono.Cecil (9)
Mono.Cecil.PE\ImageReader.cs (8)
48 throw new BadImageFormatException (); 58 throw new BadImageFormatException (); 65 throw new BadImageFormatException (); 198 throw new BadImageFormatException (); 302 throw new BadImageFormatException (); 318 throw new BadImageFormatException (); 769 throw new BadImageFormatException (stream.value.GetFileName (), e); 793 throw new BadImageFormatException (stream.value.GetFileName (), e);
Mono.Cecil\WindowsRuntimeProjections.cs (1)
851 throw new BadImageFormatException ("Missing mscorlib reference in AssemblyRef table.");
rzc (1)
MetadataReaderExtensions.cs (1)
16throw new BadImageFormatException();
System.Private.CoreLib (74)
Internal\Runtime\TypeLoaderExceptionHelper.cs (1)
24return new BadImageFormatException(GetFormatString(id));
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\TypeLoader\ExternalReferencesTable.cs (1)
73throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (2)
20throw new BadImageFormatException(); 259throw new BadImageFormatException();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
262throw new BadImageFormatException(SR.BadImageFormat_EmptyAssembly);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
73throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResType_SerBlobMismatch, type.FullName, graph.GetType().FullName)); 173throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (27)
184throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 339throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 348throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 364throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 387throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 393throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 545throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 549throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 627throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 631throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 704throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 711throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 718throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 732throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 744throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 758throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 786throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof); 790throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e); 813throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 848throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 856throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 898throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 919throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 930throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 946throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 955throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 971throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
752return new System.BadImageFormatException(); 754return new System.BadImageFormatException();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (2)
428throw new BadImageFormatException(SR.BadImageFormat_EmptyAssembly); 464throw new BadImageFormatException(SR.BadImageFormat_BadILFormat);
System\Reflection\Runtime\CustomAttributes\NativeFormat\NativeFormatCustomAttributeData.cs (2)
91throw new BadImageFormatException(); 115throw new BadImageFormatException();
System\Reflection\Runtime\CustomAttributes\RuntimeCustomAttributeData.cs (1)
173throw new BadImageFormatException();
System\Reflection\Runtime\EventInfos\RuntimeEventInfo.cs (2)
40throw new BadImageFormatException(); // Added is a required method. 104throw new BadImageFormatException(); // Removed is a required method.
System\Reflection\Runtime\FieldInfos\RuntimeFieldInfo.cs (2)
169throw new BadImageFormatException(); // Field marked literal but has no default value. 207throw new BadImageFormatException(); // Field marked literal but has no default value.
System\Reflection\Runtime\General\Assignability.cs (1)
226throw new BadImageFormatException(); // Unexpected variance value in metadata.
System\Reflection\Runtime\General\MetadataReaderExtensions.NativeFormat.cs (16)
68throw new BadImageFormatException(); 158throw new BadImageFormatException(); 170throw new BadImageFormatException(); 179throw new BadImageFormatException(); 188throw new BadImageFormatException(); 197throw new BadImageFormatException(); 206throw new BadImageFormatException(); 215throw new BadImageFormatException(); 224throw new BadImageFormatException(); 233throw new BadImageFormatException(); 240throw new BadImageFormatException(); 283throw new BadImageFormatException(); 414throw new BadImageFormatException(); 454throw new BadImageFormatException(); 468throw new BadImageFormatException(); 559throw new BadImageFormatException();
System\Reflection\Runtime\General\NamespaceChain.cs (3)
42throw new BadImageFormatException(); 51throw new BadImageFormatException(); 67throw new BadImageFormatException(); // null namespace fragment found in middle.
System\Reflection\Runtime\General\QHandles.NativeFormat.cs (1)
64throw new BadImageFormatException();
System\Reflection\Runtime\General\QSignatureTypeHandle.cs (1)
49throw new BadImageFormatException(); // Expected TypeRef, Def or Spec with MetadataReader
System\Reflection\Runtime\General\QSignatureTypeHandle.NativeFormat.cs (1)
24throw new BadImageFormatException();
System\Reflection\Runtime\General\TypeResolver.cs (2)
34throw new BadImageFormatException(); // Expected TypeRef, Def or Spec with MetadataReader 51throw new BadImageFormatException(); // Expected TypeRef, Def or Spec with MetadataReader
System\Reflection\Runtime\General\TypeResolver.NativeFormat.cs (3)
45throw new BadImageFormatException(); // Expected TypeRef, Def or Spec. 70throw new BadImageFormatException(); // Bad rank. 232throw new BadImageFormatException(); // Expected TypeReference parent to be typeRef, typeDef or namespaceRef.
System\Reflection\Runtime\MethodInfos\RuntimeNamedMethodInfo.cs (1)
140throw new BadImageFormatException(SR.CannotUseByRefLikeTypeInInstantiation);
System.Private.Reflection.Execution (3)
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.ManifestResources.cs (1)
84throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (2)
20throw new BadImageFormatException(); 259throw new BadImageFormatException();
System.Private.StackTraceMetadata (2)
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (2)
20throw new BadImageFormatException(); 259throw new BadImageFormatException();
System.Private.TypeLoader (5)
Internal\Runtime\TypeLoader\TypeBuilder.cs (1)
334throw new BadImageFormatException();
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\TypeLoader\ExternalReferencesTable.cs (1)
73throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (2)
20throw new BadImageFormatException(); 259throw new BadImageFormatException();
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemContext.cs (1)
645throw new BadImageFormatException();
System.Reflection.Metadata (95)
System\Reflection\Metadata\BlobReader.cs (2)
349throw new BadImageFormatException(SR.ValueTooLarge); 697throw new BadImageFormatException(SR.InvalidConstantValue);
System\Reflection\Metadata\Ecma335\CustomAttributeDecoder.cs (16)
46throw new BadImageFormatException(); 55throw new BadImageFormatException(); 61throw new BadImageFormatException(); 68throw new BadImageFormatException(); 82throw new BadImageFormatException(); 134throw new BadImageFormatException(); 204throw new BadImageFormatException(); 216throw new BadImageFormatException(); 223throw new BadImageFormatException(); 235throw new BadImageFormatException(); 278throw new BadImageFormatException(); 294throw new BadImageFormatException(); 374throw new BadImageFormatException(); 395throw new BadImageFormatException(); 419_ => throw new BadImageFormatException(SR.NotTypeDefOrRefHandle), 508throw new BadImageFormatException();
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (1)
227throw new BadImageFormatException(SR.EnCMapNotSorted);
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (6)
130throw new BadImageFormatException(SR.Format(SR.UnexpectedSignatureTypeCode, typeCode)); 145throw new BadImageFormatException(SR.SignatureTypeSequenceMustHaveAtLeastOneElement); 316throw new BadImageFormatException(SR.NotTypeDefOrRefHandle); 328throw new BadImageFormatException(SR.NotTypeDefOrRefOrSpecHandle); 335throw new BadImageFormatException(SR.Format(SR.UnexpectedSignatureHeader, expectedKind, header.Kind, header.RawValue)); 344throw new BadImageFormatException(SR.Format(SR.UnexpectedSignatureHeader2, SignatureKind.Property, SignatureKind.Method, header.Kind, header.RawValue));
System\Reflection\Metadata\IL\MethodBodyBlock.cs (4)
121throw new BadImageFormatException(SR.Format(SR.InvalidMethodHeader1, headByte)); 128throw new BadImageFormatException(SR.Format(SR.InvalidMethodHeader2, headByte, headByte2)); 149throw new BadImageFormatException(SR.Format(SR.InvalidLocalSignatureToken, unchecked((uint)localSignatureToken))); 162throw new BadImageFormatException(SR.Format(SR.InvalidSehHeader, sehHeader));
System\Reflection\Metadata\Internal\BlobHeap.cs (1)
192throw new BadImageFormatException(SR.InvalidDocumentName);
System\Reflection\Metadata\MetadataReader.cs (23)
136throw new BadImageFormatException(SR.Format(SR.ModuleTableInvalidNumberOfRows, this.ModuleTable.NumberOfRows)); 182throw new BadImageFormatException(SR.MetadataHeaderTooSmall); 188throw new BadImageFormatException(SR.MetadataSignature); 203throw new BadImageFormatException(SR.NotEnoughSpaceForVersionString); 246throw new BadImageFormatException(SR.StreamHeaderTooSmall); 256throw new BadImageFormatException(SR.NotEnoughSpaceForStreamHeaderName); 281throw new BadImageFormatException(SR.NotEnoughSpaceForStringStream); 290throw new BadImageFormatException(SR.NotEnoughSpaceForBlobStream); 299throw new BadImageFormatException(SR.NotEnoughSpaceForGUIDStream); 308throw new BadImageFormatException(SR.NotEnoughSpaceForBlobStream); 317throw new BadImageFormatException(SR.NotEnoughSpaceForMetadataStream); 327throw new BadImageFormatException(SR.NotEnoughSpaceForMetadataStream); 337throw new BadImageFormatException(SR.NotEnoughSpaceForMetadataStream); 347throw new BadImageFormatException(SR.NotEnoughSpaceForMetadataStream); 361throw new BadImageFormatException(SR.InvalidMetadataStreamFormat); 436throw new BadImageFormatException(SR.MetadataTableHeaderTooSmall); 467throw new BadImageFormatException(SR.Format(SR.UnknownTables, presentTables)); 478throw new BadImageFormatException(SR.IllegalTablesInCompressedMetadataStream); 503throw new BadImageFormatException(SR.TableRowCountSpaceTooSmall); 509throw new BadImageFormatException(SR.Format(SR.InvalidRowCount, rowCount)); 539throw new BadImageFormatException(SR.Format(SR.InvalidEntryPointToken, entryPointToken)); 549throw new BadImageFormatException(SR.Format(SR.UnknownTables, externalTableMask)); 781throw new BadImageFormatException(SR.MetadataTablesTooSmall);
System\Reflection\Metadata\MetadataReader.netstandard.cs (2)
87throw new BadImageFormatException(SR.PEImageDoesNotHaveMetadata, assemblyFile); 110throw new BadImageFormatException(ex.Message, assemblyFile, ex);
System\Reflection\Metadata\MetadataReader.WinMD.cs (1)
658throw new BadImageFormatException(SR.WinMDMissingMscorlibRef);
System\Reflection\Metadata\PEReaderExtensions.cs (1)
34throw new BadImageFormatException(SR.Format(SR.InvalidMethodRva, relativeVirtualAddress));
System\Reflection\Metadata\PortablePdb\ImportDefinitionCollection.cs (1)
123throw new BadImageFormatException(SR.Format(SR.InvalidImportDefinitionKind, kind));
System\Reflection\Metadata\TypeSystem\MemberReference.cs (1)
108_ => throw new BadImageFormatException(),
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (1)
67_ => throw new BadImageFormatException(),
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (1)
146throw new BadImageFormatException(SR.InvalidTypeSize);
System\Reflection\PortableExecutable\PEHeader.cs (1)
289throw new BadImageFormatException(SR.UnknownPEMagicValue);
System\Reflection\PortableExecutable\PEHeaders.cs (9)
96throw new BadImageFormatException(SR.InvalidPESignature); 107throw new BadImageFormatException(SR.UnknownFileFormat); 256throw new BadImageFormatException(SR.InvalidCorHeaderSize); 281throw new BadImageFormatException(SR.UnknownFileFormat); 301throw new BadImageFormatException(SR.InvalidPESignature); 311throw new BadImageFormatException(SR.InvalidNumberOfSections); 347throw new BadImageFormatException(SR.SectionTooSmall); 414throw new BadImageFormatException(SR.MissingDataDirectory); 425throw new BadImageFormatException(SR.InvalidMetadataSectionSpan);
System\Reflection\PortableExecutable\PEReader.cs (5)
548throw new BadImageFormatException(SR.InvalidDirectoryRVA); 553throw new BadImageFormatException(SR.InvalidDirectorySize); 572throw new BadImageFormatException(SR.InvalidDebugDirectoryEntryCharacteristics); 627throw new BadImageFormatException(SR.UnexpectedCodeViewDataSignature); 666throw new BadImageFormatException(SR.InvalidPdbChecksumDataFormat);
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (7)
58throw new BadImageFormatException(SR.Format(SR.UnsupportedFormatVersion, PortablePdbVersions.Format(formatVersion))); 64throw new BadImageFormatException(SR.Format(SR.UnsupportedFormatVersion, PortablePdbVersions.Format(embeddedBlobVersion))); 76throw new BadImageFormatException(SR.UnexpectedEmbeddedPortablePdbDataSignature); 87throw new BadImageFormatException(SR.DataTooBig, e); 106throw new BadImageFormatException(e.Message, e); 111throw new BadImageFormatException(SR.SizeMismatch); 120throw new BadImageFormatException(SR.SizeMismatch);
System\Reflection\Throw.cs (12)
155throw new BadImageFormatException(SR.OutOfBoundsRead); 167throw new BadImageFormatException(SR.InvalidCodedIndex); 173throw new BadImageFormatException(SR.InvalidHandle); 179throw new BadImageFormatException(SR.InvalidCompressedInteger); 185throw new BadImageFormatException(SR.InvalidSerializedString); 191throw new BadImageFormatException(SR.ImageTooSmall); 197throw new BadImageFormatException(SR.ImageTooSmallOrContainsInvalidOffsetOrCount); 203throw new BadImageFormatException(SR.RowIdOrHeapOffsetTooLarge); 209throw new BadImageFormatException(SR.Format(SR.MetadataTableNotSorted, tableIndex)); 227throw new BadImageFormatException(SR.TooManySubnamespaces); 233throw new BadImageFormatException(SR.ValueTooLarge); 239throw new BadImageFormatException(SR.SequencePointValueOutOfRange);
System.Reflection.MetadataLoadContext (23)
System\Reflection\MetadataLoadContext.Loading.cs (1)
27throw new BadImageFormatException(SR.NoMetadataInPeImage);
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeData.cs (3)
52throw new BadImageFormatException(); 86throw new BadImageFormatException(); 89throw new BadImageFormatException();
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (1)
167throw new BadImageFormatException();
System\Reflection\TypeLoading\General\Assignability.cs (1)
224throw new BadImageFormatException(); // Unexpected variance value in metadata.
System\Reflection\TypeLoading\General\Ecma\EcmaDefaultValueProcessing.cs (3)
15throw new BadImageFormatException(); 23throw new BadImageFormatException(); 75throw new BadImageFormatException();
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (1)
77throw new BadImageFormatException(SR.Format(SR.UnexpectedUnderlyingEnumType, enumType, type));
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (4)
24_ => throw new BadImageFormatException(), 105throw new BadImageFormatException(SR.Format(SR.BadImageFormat_TypeRefModuleNotInManifest, module.Assembly.FullName, $"0x{handle.GetToken():x8}")); 114throw new BadImageFormatException(SR.Format(SR.BadImageFormat_TypeRefBadScopeType, module.Assembly.FullName, $"0x{handle.GetToken():x8}")); 144_ => throw new BadImageFormatException(), // Not a legal token type to be found in a GenericParameter.Parent record.
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodDecoder.cs (1)
138_ => throw new BadImageFormatException(),
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (2)
74throw new BadImageFormatException(); 83throw new BadImageFormatException();
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.ManifestResources.cs (2)
41throw new BadImageFormatException(); 57throw new BadImageFormatException(SR.Format(SR.ManifestResourceInfoReferencedBadModule, result.FileName));
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.TypeProvider.cs (3)
30throw new BadImageFormatException(); // TypeSpec tried to instantiate a non-definition type as a generic type. 35public RoType GetGenericTypeParameter(TypeContext genericContext, int index) => genericContext.GetGenericTypeArgumentOrNull(index) ?? throw new BadImageFormatException(SR.Format(SR.GenericTypeParamIndexOutOfRange, index)); 36public RoType GetGenericMethodParameter(TypeContext genericContext, int index) => genericContext.GetGenericMethodArgumentOrNull(index) ?? throw new BadImageFormatException(SR.Format(SR.GenericMethodParamIndexOutOfRange, index));
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
135throw new BadImageFormatException(); // Property has neither a getter or setter.
System.Resources.Extensions (33)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (27)
184throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 339throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 348throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 364throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 387throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 393throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 545throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 549throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 627throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 631throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 704throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 711throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 718throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 732throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 744throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 758throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 786throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof); 790throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e); 813throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 848throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 856throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 898throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 919throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 930throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 946throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 955throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 971throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
System\Resources\Extensions\DeserializingResourceReader.cs (6)
136throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, length)); 155throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, length)); 165throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, length)); 200throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, length)); 225throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 231throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResType_SerBlobMismatch, type.FullName, value.GetType().FullName));
381 references to BadImageFormatException
Aspire.Hosting.RemoteHost (3)
CodeGeneration\CodeGenerationDiagnostic.cs (2)
180case BadImageFormatException bife: 251or BadImageFormatException
IntegrationLoadContext.cs (1)
99catch (BadImageFormatException ex)
Crossgen2Tasks (1)
PrepareForReadyToRunCompilation.cs (1)
513catch (BadImageFormatException)
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
141if (ie is BadImageFormatException
ILCompiler.Compiler (2)
Compiler\DependencyAnalysis\CustomAttributeBasedDependencyAlgorithm.cs (1)
153catch (BadImageFormatException)
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
211catch (BadImageFormatException ex)
ILCompiler.ReadyToRun (1)
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (1)
211catch (BadImageFormatException ex)
ILCompiler.RyuJit (1)
Compiler\DependencyAnalysis\MethodCodeNode.cs (1)
289catch (BadImageFormatException)
illink (2)
installer.tasks (1)
FileUtilities.cs (1)
41catch (BadImageFormatException)
Microsoft.Build (1)
src\msbuild\src\Shared\TaskEngineAssemblyResolver.cs (1)
138catch (BadImageFormatException)
Microsoft.Build.Framework (1)
ExceptionHandling.cs (1)
137|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
Microsoft.Build.Tasks.Core (9)
AssemblyDependency\ReferenceTable.cs (4)
515catch (BadImageFormatException e) 690catch (BadImageFormatException e) 1224catch (BadImageFormatException e) 1357catch (BadImageFormatException e)
AssemblyDependency\ResolveAssemblyReference.cs (1)
2819catch (BadImageFormatException)
AssemblyDependency\Resolver.cs (1)
222catch (BadImageFormatException)
GetAssemblyIdentity.cs (1)
80catch (BadImageFormatException e)
ManifestUtil\Manifest.cs (1)
583BadImageFormatException exception = new BadImageFormatException(null, a.ResolvedPath);
ResolveNonMSBuildProjectOutput.cs (1)
118catch (BadImageFormatException)
Microsoft.CodeAnalysis (195)
AssemblyUtilities.cs (3)
23/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception> 59/// <exception cref="BadImageFormatException">If one of the files is not an assembly or is somehow corrupted.</exception> 97/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
AssemblyUtilitiesCore.cs (1)
26/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
CommandLine\CommandLineArguments.cs (1)
446catch (Exception e) when (diagnosticsOpt != null && (e is BadImageFormatException || e is IOException))
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (1)
63catch (Exception e) when (e is BadImageFormatException || e is IOException)
Compilation\Compilation.cs (1)
2040catch (BadImageFormatException ex)
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
223/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
Emit\EditAndContinue\DefinitionMap.cs (3)
352catch (Exception e) when (e is InvalidDataException or IOException or BadImageFormatException) 437catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException || e is IOException) 753catch (Exception e) when (e is InvalidDataException or IOException or BadImageFormatException)
Emit\EditAndContinue\EmitBaseline.cs (1)
136/// <exception cref="BadImageFormatException">Module metadata is invalid.</exception>
Emit\EditAndContinueMethodDebugInformation.cs (3)
135catch (BadImageFormatException) 251catch (BadImageFormatException) 355catch (BadImageFormatException)
MetadataReader\MetadataDecoder.cs (42)
183catch (BadImageFormatException mrEx) 196/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 204/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 434/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 522catch (BadImageFormatException mrEx) 541/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 722catch (BadImageFormatException mrEx) 730/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 849/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 920catch (BadImageFormatException mrEx) 939/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1205internal ParamInfo<TypeSymbol>[] GetSignatureForMethod(MethodDefinitionHandle methodDef, out SignatureHeader signatureHeader, out BadImageFormatException metadataException, bool setParamHandles = true) 1237catch (BadImageFormatException mrEx) 1256/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1266internal ParamInfo<TypeSymbol>[] GetSignatureForProperty(PropertyDefinitionHandle handle, out SignatureHeader signatureHeader, out BadImageFormatException BadImageFormatException) 1280catch (BadImageFormatException mrEx) 1305catch (BadImageFormatException) 1317/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1401/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1436/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1456/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1483/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1553/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1601catch (BadImageFormatException) 1613catch (BadImageFormatException) 1672catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException) 1696catch (BadImageFormatException) 1734catch (BadImageFormatException) 1742/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1768/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1774/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1782/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1809catch (Exception e) when ((e is UnsupportedSignatureContent || e is BadImageFormatException) && !isFunctionPointerSignature) 1813paramInfo[paramIndex].Type = GetUnsupportedMetadataTypeSymbol(e as BadImageFormatException); 1820/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 1848catch (BadImageFormatException mrEx) 1882catch (BadImageFormatException mrEx) 1949catch (BadImageFormatException) 2022catch (BadImageFormatException) 2034/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 2241catch (BadImageFormatException) 2275catch (BadImageFormatException)
MetadataReader\MetadataReaderExtensions.cs (6)
42/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 61/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 87/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 93/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 189catch (BadImageFormatException) 197/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception>
MetadataReader\ModuleExtensions.cs (3)
29catch (BadImageFormatException) 76catch (BadImageFormatException) 89catch (BadImageFormatException)
MetadataReader\PEAssembly.cs (1)
59/// <exception cref="BadImageFormatException"/>
MetadataReader\PEModule.cs (105)
366/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 379/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 413/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 454/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 491/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 497/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 510/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 520/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 526/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 558/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 564/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 570/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 576/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 582/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 588/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 603/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 609/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 615/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 633/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 666/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 753/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 833/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 864catch (BadImageFormatException) 887catch (BadImageFormatException) 893/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 899/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 908/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 914/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 920/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 926/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 932/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 938/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 994catch (BadImageFormatException) 1381catch (BadImageFormatException) { } 1422catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { } 1481catch (Exception ex) when (ex is BadImageFormatException or UnsupportedSignatureContent) 1589catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { } 1857catch (BadImageFormatException) 2069catch (BadImageFormatException) 2174catch (BadImageFormatException) 2217catch (BadImageFormatException) { } 2291catch (BadImageFormatException) 2550catch (BadImageFormatException) 2583catch (BadImageFormatException) 2605catch (BadImageFormatException) 2611/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 2665catch (BadImageFormatException) 2742catch (BadImageFormatException) 2807catch (BadImageFormatException) 2835catch (BadImageFormatException) 2889catch (BadImageFormatException) 2896/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3057catch (BadImageFormatException) 3128catch (BadImageFormatException) 3193catch (BadImageFormatException) 3230catch (BadImageFormatException) 3292/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3306/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3318/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3333/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3339/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3345/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3351/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3357/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3373/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3379/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3385/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3391/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3397/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3413/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3424/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3430/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3453catch (BadImageFormatException) 3463/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3469/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3475/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3481/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3487/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3504/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3515/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3522/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3532/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3538/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3544/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3559/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3565/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3582/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3588/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3594/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3600/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3623catch (BadImageFormatException) 3640catch (BadImageFormatException) 3650/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3656/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3664/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3689catch (BadImageFormatException) 3708catch (BadImageFormatException) 3726catch (BadImageFormatException) 3732/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3882catch (BadImageFormatException) 3924catch (BadImageFormatException) 3955/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3961/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3967/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3994/// <exception cref="BadImageFormatException">Invalid metadata.</exception>
MetadataReader\SymbolFactory.cs (1)
16internal abstract TypeSymbol GetUnsupportedMetadataTypeSymbol(ModuleSymbol moduleSymbol, BadImageFormatException exception);
MetadataReader\TypeNameDecoder.cs (1)
60protected TypeSymbol GetUnsupportedMetadataTypeSymbol(BadImageFormatException exception = null)
MetadataReference\AssemblyMetadata.cs (8)
51/// Shall only throw <see cref="BadImageFormatException"/> or <see cref="IOException"/>. 127/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 138/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 149/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 278/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 304/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 312/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 407/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
MetadataReference\ModuleMetadata.cs (5)
202/// <exception cref="BadImageFormatException"> 325/// <exception cref="BadImageFormatException">Invalid metadata.</exception> 335/// <exception cref="BadImageFormatException">Invalid metadata.</exception> 353/// <exception cref="BadImageFormatException">When an invalid module name is encountered.</exception> 364/// <exception cref="BadImageFormatException">When an invalid module name is encountered.</exception>
MetadataReference\PortableExecutableReference.cs (4)
135/// <exception cref="BadImageFormatException">If the PE image format is invalid.</exception> 165/// <exception cref="BadImageFormatException">If the PE image format is invalid.</exception> 178/// <exception cref="BadImageFormatException">If the PE image format is invalid.</exception> 188if (e is BadImageFormatException)
ReferenceManager\CommonReferenceManager.Resolution.cs (2)
473/// If any of the following exceptions: <see cref="BadImageFormatException"/>, <see cref="FileNotFoundException"/>, <see cref="IOException"/>, 504catch (Exception e) when (e is BadImageFormatException || e is IOException)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (2)
874/// <exception cref="BadImageFormatException">The PDB is malformed or there are multiple entries of the given <paramref name="kind"/>.</exception> 902/// <exception cref="BadImageFormatException">The PDB is malformed.</exception>
Microsoft.CodeAnalysis.CSharp (67)
Compilation\CSharpCompilation.cs (1)
3948catch (BadImageFormatException)
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
187catch (BadImageFormatException)
Emitter\Model\PEAssemblyBuilder.cs (1)
197catch (BadImageFormatException)
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
168catch (BadImageFormatException)
Symbols\Metadata\PE\MetadataDecoder.cs (1)
305catch (BadImageFormatException mrEx)
Symbols\Metadata\PE\PEEventSymbol.cs (2)
82catch (BadImageFormatException mrEx) 489BadImageFormatException? mrEx;
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
173catch (BadImageFormatException)
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
94catch (BadImageFormatException)
Symbols\Metadata\PE\PEMethodSymbol.cs (6)
439catch (BadImageFormatException) 567catch (BadImageFormatException) 673catch (BadImageFormatException) 865BadImageFormatException mrEx; 930catch (BadImageFormatException) 985catch (BadImageFormatException)
Symbols\Metadata\PE\PEModuleSymbol.cs (3)
292catch (BadImageFormatException) 319catch (BadImageFormatException) 346catch (BadImageFormatException)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (36)
213BadImageFormatException mrEx = null; 244private static void GetGenericInfo(PEModuleSymbol moduleSymbol, TypeDefinitionHandle handle, out GenericParameterHandleCollection genericParameterHandles, out ushort arity, out BadImageFormatException mrEx) 252catch (BadImageFormatException e) 269BadImageFormatException mrEx = null; 331catch (BadImageFormatException) 344catch (BadImageFormatException) 805catch (BadImageFormatException mrEx) 844catch (BadImageFormatException mrEx) 1089catch (BadImageFormatException) 1093catch (BadImageFormatException) 1104catch (BadImageFormatException) 1108catch (BadImageFormatException) 1119catch (BadImageFormatException) 1123catch (BadImageFormatException) 1134catch (BadImageFormatException) 1138catch (BadImageFormatException) 1277catch (Exception ex) when (ex is BadImageFormatException or UnsupportedSignatureContent) 1377catch (BadImageFormatException) 1394catch (BadImageFormatException) 1501catch (BadImageFormatException) 1557catch (BadImageFormatException) 1585catch (BadImageFormatException) 1667catch (BadImageFormatException) 1699catch (BadImageFormatException mrEx) 1755catch (BadImageFormatException) 1767catch (BadImageFormatException) 2324catch (BadImageFormatException) 2399catch (BadImageFormatException) 2438catch (BadImageFormatException) 2545catch (BadImageFormatException) 2562catch (BadImageFormatException) 2597catch (BadImageFormatException) 2632catch (BadImageFormatException) 2636catch (BadImageFormatException) 2673catch (BadImageFormatException) 2677catch (BadImageFormatException)
Symbols\Metadata\PE\PENamespaceSymbol.cs (1)
309catch (BadImageFormatException)
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
282catch (BadImageFormatException)
Symbols\Metadata\PE\PEPropertySymbol.cs (5)
222BadImageFormatException propEx; 256BadImageFormatException mrEx = null; 262catch (BadImageFormatException e) 277BadImageFormatException getEx = null; 279BadImageFormatException setEx = null;
Symbols\Metadata\PE\PETypeParameterSymbol.cs (2)
84catch (BadImageFormatException) 417catch (BadImageFormatException)
Symbols\Metadata\PE\SymbolFactory.cs (1)
74internal override TypeSymbol GetUnsupportedMetadataTypeSymbol(PEModuleSymbol moduleSymbol, BadImageFormatException exception)
Symbols\Source\SourceAssemblySymbol.cs (1)
1042catch (BadImageFormatException)
Symbols\UnsupportedMetadataTypeSymbol.cs (2)
13private readonly BadImageFormatException? _mrEx; 15internal UnsupportedMetadataTypeSymbol(BadImageFormatException? mrEx = null)
Microsoft.CodeAnalysis.Features (8)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
78catch (Exception ex) when (ex is BadImageFormatException or IOException)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
91catch (Exception ex) when (ex is BadImageFormatException or IOException)
Emit\CompilationOutputs.cs (2)
42/// <exception cref="BadImageFormatException">Invalid format of the assembly data.</exception> 91/// <exception cref="BadImageFormatException">Invalid format of the PDB or assembly data.</exception>
PdbSourceDocument\PdbFileLocatorService.cs (1)
103catch (BadImageFormatException ex)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
190catch (BadImageFormatException ex) when (FatalError.ReportAndCatch(ex))
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (2)
874/// <exception cref="BadImageFormatException">The PDB is malformed or there are multiple entries of the given <paramref name="kind"/>.</exception> 902/// <exception cref="BadImageFormatException">The PDB is malformed.</exception>
Microsoft.CodeAnalysis.VisualBasic (2)
CommandLine\VisualBasicCommandLineArguments.vb (1)
102Catch e As BadImageFormatException
Symbols\Metadata\PE\PEEventSymbol.vb (1)
66Catch mrEx As BadImageFormatException
Microsoft.CodeAnalysis.Workspaces (6)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (4)
76catch (Exception e) when (e is BadImageFormatException or IOException) 88catch (Exception e) when (e is BadImageFormatException or IOException) 285catch (BadImageFormatException) 316catch (BadImageFormatException)
Serialization\SerializerService_Reference.cs (1)
256catch (Exception ex) when (ex is BadImageFormatException or
src\roslyn\src\Compilers\Core\Portable\AssemblyUtilitiesCore.cs (1)
26/// <exception cref="BadImageFormatException">If the file is not an assembly or is somehow corrupted.</exception>
Microsoft.DotNet.Build.Tasks.Packaging (1)
VersionUtility.cs (1)
49catch (BadImageFormatException)
Microsoft.DotNet.PackageTesting (2)
VerifyClosure.cs (1)
447catch(BadImageFormatException)
VerifyTypes.cs (1)
166catch (BadImageFormatException)
Microsoft.DotNet.SharedFramework.Sdk (3)
src\arcade\src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (1)
447catch(BadImageFormatException)
src\arcade\src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (1)
166catch (BadImageFormatException)
src\FileUtilities.cs (1)
50catch (BadImageFormatException)
Microsoft.NET.Build.Extensions.Tasks (2)
GetDependsOnNETStandard.cs (1)
84return e is BadImageFormatException
src\sdk\src\Tasks\Common\FileUtilities.MetadataReader.cs (1)
67catch (BadImageFormatException)
Microsoft.NET.Build.Tasks (4)
CheckForUnsupportedWinMDReferences.cs (1)
106catch (BadImageFormatException)
GenerateClsidMap.cs (1)
55catch (BadImageFormatException)
PrepareForReadyToRunCompilation.cs (1)
550catch (BadImageFormatException)
src\sdk\src\Tasks\Common\FileUtilities.MetadataReader.cs (1)
67catch (BadImageFormatException)
Microsoft.NET.HostModel (1)
Bundle\Bundler.cs (1)
196catch (BadImageFormatException)
Microsoft.NET.Sdk.Razor.Tasks (1)
ReferenceResolver.cs (1)
142catch (BadImageFormatException)
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
Navigation\PortablePdbReader.cs (1)
159catch (BadImageFormatException exception)
Mono.Cecil (1)
Mono.Cecil\BaseAssemblyResolver.cs (1)
220 } catch (System.BadImageFormatException) {
MSBuild (2)
src\msbuild\src\Shared\TaskEngineAssemblyResolver.cs (1)
138catch (BadImageFormatException)
XMake.cs (1)
4461catch (BadImageFormatException e) when (!loggerDescription.IsOptional)
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
61[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.BadImageFormatException))]
netstandard (1)
netstandard.cs (1)
54[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.BadImageFormatException))]
PresentationFramework (2)
System\Windows\Documents\Serialization\SerializerProvider.cs (1)
164catch (BadImageFormatException)
System\Windows\SystemResources.cs (1)
798catch (BadImageFormatException)
RepoTasks (1)
FileUtilities.cs (1)
41catch (BadImageFormatException)
sdk-tasks (1)
AddMetadataIsPE.cs (1)
50catch (BadImageFormatException) { }
System.ComponentModel.Composition (5)
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (4)
64/// <exception cref="BadImageFormatException"> 120/// <exception cref="BadImageFormatException"> 177/// <exception cref="BadImageFormatException"> 241/// <exception cref="BadImageFormatException">
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (1)
679catch (BadImageFormatException ex)
System.Diagnostics.StackTrace (2)
System\Diagnostics\StackTraceSymbols.cs (2)
162catch (BadImageFormatException) 212catch (Exception e) when (e is BadImageFormatException || e is IOException)
System.Private.CoreLib (3)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
376catch (BadImageFormatException)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.cs (2)
39/// <exception cref="BadImageFormatException">If the library is not valid.</exception> 83/// <exception cref="BadImageFormatException">If the library is not valid.</exception>
System.Reflection.Metadata (39)
System\Reflection\Metadata\BlobReader.cs (10)
91/// <exception cref="BadImageFormatException">Offset is set outside the bounds of underlying reader.</exception> 341/// <exception cref="BadImageFormatException">The data at the current position was not a valid <see cref="decimal"/> number.</exception> 394/// <exception cref="BadImageFormatException"><paramref name="byteCount"/> bytes not available.</exception> 407/// <exception cref="BadImageFormatException"><paramref name="byteCount"/> bytes not available.</exception> 420/// <exception cref="BadImageFormatException"><paramref name="byteCount"/> bytes not available.</exception> 434/// <exception cref="BadImageFormatException"><paramref name="byteCount"/> bytes not available.</exception> 473/// <exception cref="BadImageFormatException">The data at the current position was not a valid compressed integer.</exception> 529/// <exception cref="BadImageFormatException">The data at the current position was not a valid compressed integer.</exception> 585/// <exception cref="BadImageFormatException">If the encoding is invalid.</exception> 635/// <exception cref="BadImageFormatException">Error while reading from the blob.</exception>
System\Reflection\Metadata\Decoding\ICustomAttributeTypeProvider.cs (2)
22/// <exception cref="BadImageFormatException">The name is malformed.</exception> 28/// <exception cref="BadImageFormatException">The given type symbol does not represent an enum.</exception>
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (3)
52/// <exception cref="System.BadImageFormatException">The reader was not positioned at a valid signature type.</exception> 163/// <exception cref="System.BadImageFormatException">The method signature is invalid.</exception> 228/// <exception cref="System.BadImageFormatException">The local variable signature is invalid.</exception>
System\Reflection\Metadata\MetadataReader.cs (1)
69/// <exception cref="BadImageFormatException">Bad metadata header.</exception>
System\Reflection\Metadata\MetadataReader.netstandard.cs (1)
66/// <exception cref="BadImageFormatException">If <paramref name="assemblyFile"/> is not a valid assembly.</exception>
System\Reflection\Metadata\PEReaderExtensions.cs (1)
21/// <exception cref="BadImageFormatException">The body is not found in the metadata or is invalid.</exception>
System\Reflection\Metadata\PortablePdb\ImportDefinitionCollection.cs (1)
47/// <exception cref="BadImageFormatException">Invalid blob format.</exception>
System\Reflection\Metadata\TypeSystem\MemberReference.cs (1)
98/// <exception cref="BadImageFormatException">The member reference signature is invalid.</exception>
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (1)
57/// <exception cref="BadImageFormatException">The signature is invalid.</exception>
System\Reflection\PortableExecutable\PEHeaders.cs (3)
39/// <exception cref="BadImageFormatException">The data read from stream have invalid format.</exception> 53/// <exception cref="BadImageFormatException">The data read from stream have invalid format.</exception> 69/// <exception cref="BadImageFormatException">The data read from stream have invalid format.</exception>
System\Reflection\PortableExecutable\PEReader.cs (13)
127/// <exception cref="BadImageFormatException"><see cref="PEStreamOptions.PrefetchMetadata"/> is specified and the PE headers of the image are invalid.</exception> 155/// <exception cref="BadImageFormatException"><see cref="PEStreamOptions.PrefetchMetadata"/> is specified and the PE headers of the image are invalid.</exception> 293/// <exception cref="BadImageFormatException">The headers contain invalid data.</exception> 450/// <exception cref="BadImageFormatException">The PE headers contain invalid data.</exception> 461/// <exception cref="BadImageFormatException">The PE headers contain invalid data.</exception> 476/// <exception cref="BadImageFormatException">The PE headers contain invalid data.</exception> 532/// <exception cref="BadImageFormatException">Bad format of the entry.</exception> 601/// <exception cref="BadImageFormatException">Bad format of the data.</exception> 641/// <exception cref="BadImageFormatException">Bad format of the data.</exception> 708/// <exception cref="BadImageFormatException">No matching PDB file is found due to an error: The PE image or the PDB is invalid.</exception> 761Debug.Assert(errorToReport is BadImageFormatException || errorToReport is IOException); 779catch (Exception e) when (e is BadImageFormatException || e is IOException) 843catch (Exception e) when (e is BadImageFormatException || e is IOException)
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (2)
32/// <exception cref="BadImageFormatException">Bad format of the data.</exception> 152catch (Exception e) when (e is BadImageFormatException || e is IOException)
System.Resources.Extensions (1)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (1)
101catch (BadImageFormatException) { }
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
49[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.BadImageFormatException))]
System.Speech (2)
Internal\Synthesis\VoiceSynthesis.cs (2)
1385catch (BadImageFormatException) 1413catch (BadImageFormatException)
System.Windows.Forms.Design (2)
System\Drawing\Design\ToolboxItem.cs (2)
500catch (BadImageFormatException) 521catch (BadImageFormatException)
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\Accessible.cs (1)
1379else if (e is BadImageFormatException)