160 references to BadImageFormatException
BuildValidator (1)
PEReaderExtensions.cs (1)
114throw new BadImageFormatException("Failed to convert invalid RVA to offset: " + rva);
Microsoft.Build.Tasks.Core (2)
AssemblyDependency\AssemblyInformation.cs (1)
466throw new BadImageFormatException(string.Format(CultureInfo.CurrentCulture,
AssemblyDependency\ReferenceTable.cs (1)
2908throw new BadImageFormatException(ResourceUtilities.GetResourceString("ResolveAssemblyReference.ImplementationDllHasInvalidPEHeader"));
Microsoft.Build.Tasks.UnitTests (2)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (2)
1078throw new System.BadImageFormatException(@"The format of the file '" + Path.Combine(s_myVersion20Path, "BadImage.dll") + "' is invalid"); 1441throw new BadImageFormatException("X.pdb is a PDB file, not a managed assembly");
Microsoft.CodeAnalysis (7)
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 (1)
ExpressionCompiler.cs (1)
84throw new BadImageFormatException(error);
Microsoft.CodeAnalysis.Test.Utilities (5)
Metadata\DynamicAnalysisDataReader.cs (5)
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");
System.Private.CoreLib (34)
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 (21)
188throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 343throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 352throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 368throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 391throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 397throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 708throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 715throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 722throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 736throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 748throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 762throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 817throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 852throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 860throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 902throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 923throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 934throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 950throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 959throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 975throw 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\RuntimeCustomAttributeData.cs (5)
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);
src\System\Reflection\RuntimeParameterInfo.cs (3)
60throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); 75throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); 83throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch);
System.Reflection.Metadata (74)
System\Reflection\Metadata\BlobReader.cs (2)
349throw new BadImageFormatException(SR.ValueTooLarge); 697throw new BadImageFormatException(SR.InvalidConstantValue);
System\Reflection\Metadata\Ecma335\CustomAttributeDecoder.cs (1)
419_ => throw new BadImageFormatException(SR.NotTypeDefOrRefHandle),
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.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\TypeDefinition.cs (1)
150throw 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 (5)
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); 117throw new BadImageFormatException(SR.SizeMismatch); 126throw 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 (7)
System\Reflection\MetadataLoadContext.Loading.cs (1)
27throw new BadImageFormatException(SR.NoMetadataInPeImage);
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (1)
77throw new BadImageFormatException(SR.Format(SR.UnexpectedUnderlyingEnumType, enumType, type));
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (2)
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}"));
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.ManifestResources.cs (1)
57throw new BadImageFormatException(SR.Format(SR.ManifestResourceInfoReferencedBadModule, result.FileName));
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.TypeProvider.cs (2)
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.Resources.Extensions (27)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (21)
188throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 343throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 352throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); 368throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); 391throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); 397throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); 708throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 715throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 722throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 736throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 748throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); 762throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); 817throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 852throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 860throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 902throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 923throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 934throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 950throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 959throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); 975throw 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));