240 instantiations of BadImageFormatException
BuildValidator (1)
PEReaderExtensions.cs (1)
114throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva);
Microsoft.Build.Tasks.Core (5)
AssemblyDependency\AssemblyInformation.cs (1)
469throw new BadImageFormatException(string.Format(CultureInfo.CurrentCulture,
AssemblyDependency\ReferenceTable.cs (1)
2906throw new BadImageFormatException(ResourceUtilities.GetResourceString("ResolveAssemblyReference.ImplementationDllHasInvalidPEHeader"));
ManifestUtil\Manifest.cs (1)
579BadImageFormatException exception = new BadImageFormatException(null, a.ResolvedPath);
ManifestUtil\ManifestReader.cs (1)
70throw new BadImageFormatException(null, path);
ManifestUtil\TrustInfo.cs (1)
714throw new BadImageFormatException();
Microsoft.Build.Tasks.UnitTests (4)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (2)
1079throw new System.BadImageFormatException(@"The format of the file '" + Path.Combine(s_myVersion20Path, "BadImage.dll") + "' is invalid"); 1442throw new BadImageFormatException("X.pdb is a PDB file, not a managed assembly");
GetSDKReference_Tests.cs (1)
1418throw new BadImageFormatException();
ResolveNonMSBuildProjectOutput_Tests.cs (1)
182throw new BadImageFormatException(); // the hint that the caller takes for an unmanaged binary.
Microsoft.CodeAnalysis (12)
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)
262throw new BadImageFormatException(CodeAnalysisResources.PEImageDoesntContainManagedMetadata); 395throw new BadImageFormatException(string.Format(CodeAnalysisResources.InvalidModuleName, this.Name, moduleName));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
ExpressionCompiler.cs (1)
84throw new BadImageFormatException(error);
PDB\MethodDebugInfo.Portable.cs (2)
119throw new BadImageFormatException(); 439throw new BadImageFormatException();
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (2)
MetadataDecoder.cs (2)
198throw new BadImageFormatException(); 245throw new BadImageFormatException();
Microsoft.CodeAnalysis.Features (1)
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (1)
144throw new BadImageFormatException();
Microsoft.CodeAnalysis.Test.Utilities (11)
Metadata\DynamicAnalysisDataReader.cs (11)
80throw new BadImageFormatException(); 135throw new BadImageFormatException(); 167throw new BadImageFormatException(); 178throw new BadImageFormatException(); 186throw new BadImageFormatException(); 278throw new BadImageFormatException(); 307throw new BadImageFormatException(string.Format("Invalid document name", separator)); 346throw new BadImageFormatException("SequencePointValueOutOfRange"); 357throw new BadImageFormatException("SequencePointValueOutOfRange"); 368throw new BadImageFormatException("SequencePointValueOutOfRange"); 379throw new BadImageFormatException("Invalid handle");
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
226throw new BadImageFormatException();
Roslyn.Test.PdbUtilities (1)
Reader\PdbTestUtilities.cs (1)
77throw new BadImageFormatException();
System.Private.CoreLib (49)
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
262throw new BadImageFormatException(SR.BadImageFormat_BadILFormat);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
88throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResType_SerBlobMismatch, type.FullName, graph.GetType().FullName)); 188throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (27)
191throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 346throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 355throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 371throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 394throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 400throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 552throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 556throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 634throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 638throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 711throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 718throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 725throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 739throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 751throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 765throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 793throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof); 797throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e); 820throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 855throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 863throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 905throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 926throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 937throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 953throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 962throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 978throw new BadImageFormatException(SR.BadImageFormat_InvalidType);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (2)
388throw new BadImageFormatException(SR.BadImageFormat_BadILFormat); 424throw new BadImageFormatException(SR.BadImageFormat_BadILFormat);
src\System\Reflection\MdImport.cs (3)
259throw new BadImageFormatException(); 561throw new BadImageFormatException(); 619throw new BadImageFormatException();
src\System\Reflection\RuntimeCustomAttributeData.cs (8)
681throw new BadImageFormatException(SR.Arg_CustomAttributeFormatException); 733throw new BadImageFormatException(SR.Arg_CustomAttributeFormatException); 744throw new BadImageFormatException(SR.Arg_CustomAttributeFormatException); 794throw new BadImageFormatException(SR.Arg_CustomAttributeUnknownNamedArgument); 799throw new BadImageFormatException(SR.Arg_CustomAttributeDuplicateNamedArgument); 871throw new BadImageFormatException(); 895string enumTypeMaybe = parser.GetString() ?? throw new BadImageFormatException(); 899throw new BadImageFormatException();
src\System\Reflection\RuntimeParameterInfo.cs (3)
60throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); 75throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); 83throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch);
src\System\RuntimeHandles.cs (3)
669throw new BadImageFormatException(); 1144throw new BadImageFormatException(); 1503throw new BadImageFormatException();
System.Reflection.Metadata (93)
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)
226throw 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)
193throw 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)
77throw new BadImageFormatException(SR.PEImageDoesNotHaveMetadata, assemblyFile); 100throw 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)
112_ => throw new BadImageFormatException(),
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (1)
71_ => throw new BadImageFormatException(),
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (1)
150throw new BadImageFormatException(SR.InvalidTypeSize);
System\Reflection\PortableExecutable\PEHeader.cs (1)
289throw new BadImageFormatException(SR.UnknownPEMagicValue);
System\Reflection\PortableExecutable\PEHeaders.cs (7)
242throw new BadImageFormatException(SR.InvalidCorHeaderSize); 267throw new BadImageFormatException(SR.UnknownFileFormat); 287throw new BadImageFormatException(SR.InvalidPESignature); 297throw new BadImageFormatException(SR.InvalidNumberOfSections); 333throw new BadImageFormatException(SR.SectionTooSmall); 408throw new BadImageFormatException(SR.MissingDataDirectory); 419throw 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); 112throw new BadImageFormatException(e.Message, e); 117throw new BadImageFormatException(SR.SizeMismatch); 126throw new BadImageFormatException(SR.SizeMismatch);
System\Reflection\Throw.cs (12)
167throw new BadImageFormatException(SR.OutOfBoundsRead); 179throw new BadImageFormatException(SR.InvalidCodedIndex); 185throw new BadImageFormatException(SR.InvalidHandle); 191throw new BadImageFormatException(SR.InvalidCompressedInteger); 197throw new BadImageFormatException(SR.InvalidSerializedString); 203throw new BadImageFormatException(SR.ImageTooSmall); 209throw new BadImageFormatException(SR.ImageTooSmallOrContainsInvalidOffsetOrCount); 215throw new BadImageFormatException(SR.RowIdOrHeapOffsetTooLarge); 221throw new BadImageFormatException(SR.Format(SR.MetadataTableNotSorted, tableIndex)); 239throw new BadImageFormatException(SR.TooManySubnamespaces); 245throw new BadImageFormatException(SR.ValueTooLarge); 251throw 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)
136throw new BadImageFormatException(); // Property has neither a getter or setter.
System.Resources.Extensions (33)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (27)
191throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 346throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 355throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 371throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 394throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 400throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 552throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 556throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 634throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); 638throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); 711throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 718throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 725throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 739throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 751throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 765throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 793throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof); 797throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e); 820throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 855throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 863throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 905throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 926throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 937throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 953throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 962throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 978throw 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));
System.Windows.Forms.Design.Tests (1)
System\Drawing\Design\ToolboxItemTests.cs (1)
1228throw new BadImageFormatException();
410 references to BadImageFormatException
Crossgen2Tasks (1)
PrepareForReadyToRunCompilation.cs (1)
430catch (BadImageFormatException)
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
141if (ie is BadImageFormatException
illink (2)
installer.tasks (2)
FileUtilities.cs (1)
41catch (BadImageFormatException)
GenerateTestSharedFrameworkDepsFile.cs (1)
103catch (BadImageFormatException)
Microsoft.Build (2)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
TaskEngineAssemblyResolver.cs (1)
137catch (BadImageFormatException)
Microsoft.Build.Engine.OM.UnitTests (1)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
Microsoft.Build.Tasks.Core (10)
AssemblyDependency\ReferenceTable.cs (4)
483catch (BadImageFormatException e) 658catch (BadImageFormatException e) 1192catch (BadImageFormatException e) 1325catch (BadImageFormatException e)
AssemblyDependency\ResolveAssemblyReference.cs (1)
2619catch (BadImageFormatException)
AssemblyDependency\Resolver.cs (1)
215catch (BadImageFormatException)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
GetAssemblyIdentity.cs (1)
66catch (BadImageFormatException e)
ManifestUtil\Manifest.cs (1)
579BadImageFormatException exception = new BadImageFormatException(null, a.ResolvedPath);
ResolveNonMSBuildProjectOutput.cs (1)
118catch (BadImageFormatException)
Microsoft.Build.Utilities.Core (1)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
Microsoft.CodeAnalysis (193)
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)
435catch (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)
2022catch (BadImageFormatException ex)
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
220/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception>
Emit\EditAndContinue\DefinitionMap.cs (3)
294catch (Exception e) when (e is InvalidDataException or IOException or BadImageFormatException) 379catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException || e is IOException) 695catch (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)
57/// <exception cref="BadImageFormatException"/>
MetadataReader\PEModule.cs (105)
365/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 378/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 412/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 453/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 490/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 496/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 509/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 519/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 525/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 557/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 563/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 569/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 575/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 581/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 587/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 602/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 608/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 614/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 632/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 663/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 738/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 818/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 847catch (BadImageFormatException) 870catch (BadImageFormatException) 876/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 882/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 891/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 897/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 903/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 909/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 915/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 921/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 973catch (BadImageFormatException) 1338catch (BadImageFormatException) { } 1379catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { } 1436catch (Exception ex) when (ex is BadImageFormatException or UnsupportedSignatureContent) 1544catch (Exception e) when (e is UnsupportedSignatureContent or BadImageFormatException) { } 1812catch (BadImageFormatException) 2024catch (BadImageFormatException) 2129catch (BadImageFormatException) 2172catch (BadImageFormatException) { } 2246catch (BadImageFormatException) 2518catch (BadImageFormatException) 2551catch (BadImageFormatException) 2573catch (BadImageFormatException) 2579/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 2633catch (BadImageFormatException) 2710catch (BadImageFormatException) 2775catch (BadImageFormatException) 2803catch (BadImageFormatException) 2857catch (BadImageFormatException) 2864/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3025catch (BadImageFormatException) 3096catch (BadImageFormatException) 3161catch (BadImageFormatException) 3198catch (BadImageFormatException) 3260/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3274/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3286/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3301/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3307/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3313/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3319/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3325/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3341/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3347/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3353/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3359/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3365/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3381/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3392/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3398/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3421catch (BadImageFormatException) 3431/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3437/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3443/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3449/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3455/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3472/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3483/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3490/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3500/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3506/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3512/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3527/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3533/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3550/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3556/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3562/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3568/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3591catch (BadImageFormatException) 3608catch (BadImageFormatException) 3618/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3624/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3632/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3657catch (BadImageFormatException) 3676catch (BadImageFormatException) 3694catch (BadImageFormatException) 3700/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3850catch (BadImageFormatException) 3892catch (BadImageFormatException) 3923/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3929/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3935/// <exception cref="BadImageFormatException">An exception from metadata reader.</exception> 3962/// <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)
50/// Shall only throw <see cref="BadImageFormatException"/> or <see cref="IOException"/>. 126/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 137/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 148/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 276/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 302/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 310/// <exception cref="BadImageFormatException">The PE image format is invalid.</exception> 405/// <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)
472/// If any of the following exceptions: <see cref="BadImageFormatException"/>, <see cref="FileNotFoundException"/>, <see cref="IOException"/>, 503catch (Exception e) when (e is BadImageFormatException || e is IOException)
Microsoft.CodeAnalysis.CSharp (64)
Compilation\CSharpCompilation.cs (1)
3761catch (BadImageFormatException)
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
182catch (BadImageFormatException)
Emitter\Model\PEAssemblyBuilder.cs (1)
191catch (BadImageFormatException)
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
168catch (BadImageFormatException)
Symbols\Metadata\PE\MetadataDecoder.cs (1)
305catch (BadImageFormatException mrEx)
Symbols\Metadata\PE\PEEventSymbol.cs (2)
79catch (BadImageFormatException mrEx) 447BadImageFormatException? mrEx;
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
151catch (BadImageFormatException)
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
93catch (BadImageFormatException)
Symbols\Metadata\PE\PEMethodSymbol.cs (6)
423catch (BadImageFormatException) 547catch (BadImageFormatException) 651catch (BadImageFormatException) 834BadImageFormatException mrEx; 899catch (BadImageFormatException) 954catch (BadImageFormatException)
Symbols\Metadata\PE\PEModuleSymbol.cs (3)
282catch (BadImageFormatException) 402catch (BadImageFormatException) 443catch (BadImageFormatException)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (33)
187BadImageFormatException mrEx = null; 216private static void GetGenericInfo(PEModuleSymbol moduleSymbol, TypeDefinitionHandle handle, out GenericParameterHandleCollection genericParameterHandles, out ushort arity, out BadImageFormatException mrEx) 224catch (BadImageFormatException e) 239BadImageFormatException mrEx = null; 295catch (BadImageFormatException) 308catch (BadImageFormatException) 574catch (BadImageFormatException mrEx) 613catch (BadImageFormatException mrEx) 808catch (BadImageFormatException) 812catch (BadImageFormatException) 823catch (BadImageFormatException) 827catch (BadImageFormatException) 838catch (BadImageFormatException) 842catch (BadImageFormatException) 853catch (BadImageFormatException) 857catch (BadImageFormatException) 948catch (BadImageFormatException) 965catch (BadImageFormatException) 1072catch (BadImageFormatException) 1128catch (BadImageFormatException) 1156catch (BadImageFormatException) 1238catch (BadImageFormatException) 1270catch (BadImageFormatException mrEx) 1326catch (BadImageFormatException) 1338catch (BadImageFormatException) 1891catch (BadImageFormatException) 1979catch (BadImageFormatException) 1996catch (BadImageFormatException) 2023catch (BadImageFormatException) 2050catch (BadImageFormatException) 2054catch (BadImageFormatException) 2085catch (BadImageFormatException) 2089catch (BadImageFormatException)
Symbols\Metadata\PE\PENamespaceSymbol.cs (1)
303catch (BadImageFormatException)
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
281catch (BadImageFormatException)
Symbols\Metadata\PE\PEPropertySymbol.cs (5)
199BadImageFormatException propEx; 233BadImageFormatException mrEx = null; 239catch (BadImageFormatException e) 254BadImageFormatException getEx = null; 256BadImageFormatException 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)
1041catch (BadImageFormatException)
Symbols\UnsupportedMetadataTypeSymbol.cs (2)
13private readonly BadImageFormatException? _mrEx; 15internal UnsupportedMetadataTypeSymbol(BadImageFormatException? mrEx = null)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\NoPiaEmbedTypes.cs (1)
1475BadImageFormatException mrEx;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\EditAndContinue\EditAndContinueTests.cs (1)
12765[InlineData(typeof(BadImageFormatException))]
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_StructLayout.cs (1)
627catch (BadImageFormatException)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (21)
DkmUtilities.cs (2)
163catch (BadImageFormatException) 186catch (BadImageFormatException)
EESymbolProvider.cs (4)
19/// <exception cref="BadImageFormatException"></exception> 26/// <exception cref="BadImageFormatException"></exception> 46/// <exception cref="BadImageFormatException"></exception> 49/// <exception cref="BadImageFormatException"></exception>
MetadataUtilities.cs (2)
84catch (BadImageFormatException) 364catch (BadImageFormatException)
PDB\MethodDebugInfo.Native.cs (2)
86catch (BadImageFormatException) 650catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException)
PDB\MethodDebugInfo.Portable.cs (11)
18/// <exception cref="BadImageFormatException">Invalid data format.</exception> 213catch (Exception e) when (e is UnsupportedSignatureContent || e is BadImageFormatException) 283catch (BadImageFormatException) 309/// <exception cref="BadImageFormatException">Invalid data format.</exception> 384/// <exception cref="BadImageFormatException">Invalid data format.</exception> 404/// <exception cref="BadImageFormatException">Invalid data format.</exception> 415/// <exception cref="BadImageFormatException">Invalid data format.</exception> 426/// <exception cref="BadImageFormatException">Invalid data format.</exception> 448/// <exception cref="BadImageFormatException">Invalid data format.</exception> 465/// <exception cref="BadImageFormatException">Invalid data format.</exception> 477/// <exception cref="BadImageFormatException">Invalid data format.</exception>
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (2)
FunctionResolverBase.cs (1)
84catch (BadImageFormatException)
MetadataResolver.cs (1)
340catch (BadImageFormatException)
Microsoft.CodeAnalysis.Features (6)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
91catch (Exception ex) when (ex is BadImageFormatException or IOException)
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (1)
131/// <exception cref="BadImageFormatException">Invalid data format.</exception>
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)
106catch (BadImageFormatException ex)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
198catch (BadImageFormatException ex) when (FatalError.ReportAndCatch(ex))
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (1)
MetadataShadowCopyProviderTests.cs (1)
187Assert.Throws<BadImageFormatException>(() => _provider.GetMetadata(f0, MetadataImageKind.Assembly));
Microsoft.CodeAnalysis.Test.Utilities (1)
TargetFrameworkUtil.cs (1)
387catch (BadImageFormatException)
Microsoft.CodeAnalysis.UnitTests (6)
MetadataReferences\AssemblyMetadataTests.cs (2)
143Assert.Throws<BadImageFormatException>(() => metadata.GetModules()); 150Assert.Throws<BadImageFormatException>(() => metadata.GetModules());
MetadataReferences\MetadataReferenceTests.cs (1)
587Assert.Throws<BadImageFormatException>((Func<object>)((AssemblyMetadata)r.GetMetadataNoCopy()).GetAssembly);
MetadataReferences\ModuleMetadataTests.cs (3)
30Assert.Throws<BadImageFormatException>(() => metadata.GetModuleNames()); 171Assert.Throws<BadImageFormatException>(() => ModuleMetadata.CreateFromStream(new MemoryStream(), PEStreamOptions.PrefetchMetadata)); 172Assert.Throws<BadImageFormatException>(() => ModuleMetadata.CreateFromStream(new MemoryStream(), PEStreamOptions.PrefetchMetadata | PEStreamOptions.PrefetchEntireImage));
Microsoft.CodeAnalysis.VisualBasic (2)
CommandLine\VisualBasicCommandLineArguments.vb (1)
102Catch e As BadImageFormatException
Symbols\Metadata\PE\PEEventSymbol.vb (1)
66Catch mrEx As BadImageFormatException
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (3)
VisualBasicEESymbolProvider.vb (3)
52''' <exception cref="BadImageFormatException"></exception> 62''' <exception cref="BadImageFormatException"></exception> 68''' <exception cref="BadImageFormatException"></exception>
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)
241catch (Exception ex) when (ex is BadImageFormatException or
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\FileUtilities.cs (1)
50catch (BadImageFormatException)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (1)
447catch(BadImageFormatException)
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (1)
166catch (BadImageFormatException)
Microsoft.DotNet.SignTool (2)
src\ContentUtil.cs (2)
94catch (BadImageFormatException) 122catch (BadImageFormatException)
Microsoft.VisualStudio.LanguageServices (5)
ProjectSystem\MetadataReferences\VisualStudioFrameworkAssemblyPathResolverFactory.cs (1)
99catch (BadImageFormatException)
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (3)
149/// <exception cref="BadImageFormatException" /> 267/// <exception cref="BadImageFormatException" /> 327/// <exception cref="BadImageFormatException" />
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (1)
94if (e is IOException or BadImageFormatException)
MSBuild (3)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
TaskEngineAssemblyResolver.cs (1)
137catch (BadImageFormatException)
XMake.cs (1)
4394catch (BadImageFormatException e) when (!loggerDescription.IsOptional)
MSBuildTaskHost (2)
ExceptionHandling.cs (1)
253|| e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid
TaskEngineAssemblyResolver.cs (1)
137catch (BadImageFormatException)
mscorlib (1)
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)
165catch (BadImageFormatException)
System\Windows\SystemResources.cs (1)
799catch (BadImageFormatException)
Roslyn.Test.PdbUtilities (2)
EditAndContinue\EditAndContinueTestUtilities.cs (1)
27catch (Exception e) when (e is BadImageFormatException || e is IOException)
Reader\PdbTestUtilities.cs (1)
64/// <exception cref="BadImageFormatException">Invalid data format.</exception>
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 (6)
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
376catch (BadImageFormatException)
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>
src\System\Reflection\RuntimeModule.cs (3)
123catch (BadImageFormatException e) 212catch (BadImageFormatException e) 244catch (BadImageFormatException e)
System.Private.Windows.Core (1)
System\Private\Windows\BinaryFormat\Deserializer\DefaultTypeResolver.cs (1)
103catch (BadImageFormatException) { }
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)
56/// <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)
102/// <exception cref="BadImageFormatException">The member reference signature is invalid.</exception>
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (1)
61/// <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> 158catch (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)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
49[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.BadImageFormatException))]
System.Windows.Forms.Design (2)
System\Drawing\Design\ToolboxItem.cs (2)
500catch (BadImageFormatException) 521catch (BadImageFormatException)
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\Accessible.cs (1)
1383else if (e is BadImageFormatException)