204 references to SR
System.Reflection.Metadata (204)
System\Reflection\Internal\Utilities\ExceptionUtilities.cs (4)
12
return new InvalidOperationException(
SR
.Format(
SR
.UnexpectedValue, value, value.GetType().FullName));
15
return new InvalidOperationException(
SR
.Format(
SR
.UnexpectedValueUnknownType, value));
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
94
throw new ArgumentException(
SR
.StreamTooLarge, streamParameterName);
System\Reflection\Metadata\AssemblyNameInfo.cs (1)
207
: throw new ArgumentException(
SR
.InvalidAssemblyName, nameof(assemblyName));
System\Reflection\Metadata\BlobBuilder.cs (2)
538
throw new InvalidOperationException(
SR
.Format(
SR
.ReturnedBuilderSizeTooSmall, GetType(), nameof(AllocateChunk)));
System\Reflection\Metadata\BlobContentId.cs (4)
51
throw new ArgumentException(
SR
.Format(
SR
.UnexpectedArrayLength, Size), nameof(id));
90
throw new ArgumentException(
SR
.Format(
SR
.HashTooShort, minHashSize), nameof(hashCode));
System\Reflection\Metadata\BlobReader.cs (2)
349
throw new BadImageFormatException(
SR
.ValueTooLarge);
697
throw new BadImageFormatException(
SR
.InvalidConstantValue);
System\Reflection\Metadata\BlobWriterImpl.cs (4)
216
throw new ArgumentException(
SR
.Format(
SR
.InvalidConstantValueOfType, type));
289
throw new ArgumentException(
SR
.Format(
SR
.InvalidConstantValueOfType, type));
System\Reflection\Metadata\Ecma335\CustomAttributeDecoder.cs (1)
419
_ => throw new BadImageFormatException(
SR
.NotTypeDefOrRefHandle),
System\Reflection\Metadata\Ecma335\Encoding\BlobEncoders.cs (1)
1096
throw new ArgumentException(
SR
.InvalidSignature, nameof(attributes));
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (8)
57
throw new InvalidOperationException(
SR
.Format(
SR
.DistanceBetweenInstructionAndLabelTooBig, OpCode, ILOffset, distance));
268
Throw.InvalidOperation(
SR
.SwitchInstructionEncoderTooFewBranches);
276
Throw.InvalidOperation(
SR
.SwitchInstructionEncoderTooManyBranches);
387
Throw.InvalidOperation(
SR
.Format(
SR
.InvalidExceptionRegionBounds, tryStart, tryEnd));
392
Throw.InvalidOperation(
SR
.Format(
SR
.InvalidExceptionRegionBounds, handlerStart, handlerEnd));
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (1)
214
Throw.InvalidOperation(
SR
.MethodHasNoExceptionRegions);
System\Reflection\Metadata\Ecma335\Encoding\MethodBodyStreamEncoder.cs (2)
23
throw new ArgumentException(
SR
.BuilderMustAligned, nameof(builder));
186
Throw.ArgumentOutOfRange(nameof(instructionEncoder),
SR
.TooManyExceptionRegions);
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (10)
63
throw new ArgumentException(
SR
.BaseReaderMustBeFullMetadataReader, nameof(baseReader));
73
throw new ArgumentException(
SR
.Format(
SR
.ExpectedListOfSize, MetadataTokens.TableCount), nameof(baseTableRowCounts));
83
throw new ArgumentException(
SR
.Format(
SR
.ExpectedListOfSize, MetadataTokens.HeapCount), nameof(baseTableRowCounts));
89
throw new ArgumentException(
SR
.ExpectedNonEmptyList, nameof(deltaReaders));
96
throw new ArgumentException(
SR
.ReadersMustBeDeltaReaders, nameof(deltaReaders));
226
throw new BadImageFormatException(
SR
.EnCMapNotSorted);
287
throw new ArgumentException(
SR
.HandleBelongsToFutureGeneration, nameof(handle));
320
throw new ArgumentException(
SR
.HandleBelongsToFutureGeneration, nameof(handle));
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (2)
109
throw new ArgumentException(
SR
.Format(
SR
.ValueMustBeMultiple, BlobUtilities.SizeOfGuid), nameof(guidHeapStartOffset));
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (2)
372
Throw.InvalidOperation(
SR
.ModuleAlreadyAdded);
402
Throw.InvalidOperation(
SR
.AssemblyAlreadyAdded);
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (2)
428
throw new ArgumentOutOfRangeException(nameof(typeHandle),
SR
.Format(
SR
.UnexpectedHandleKind, typeHandle.Kind));
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
66
Throw.InvalidArgument(
SR
.MetadataVersionTooLong, nameof(metadataVersion));
System\Reflection\Metadata\Ecma335\MetadataTokens.cs (1)
107
throw new NotSupportedException(
SR
.CantGetOffsetForVirtualHeapHandle);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (6)
78
throw new ArgumentException(
SR
.Format(
SR
.ExpectedArrayOfSize, MetadataTokens.TableCount), nameof(typeSystemRowCounts));
90
throw new ArgumentOutOfRangeException(nameof(typeSystemRowCounts),
SR
.Format(
SR
.RowCountOutOfRange, i));
95
throw new ArgumentException(
SR
.Format(
SR
.RowCountMustBeZero, i), nameof(typeSystemRowCounts));
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (9)
130
throw new BadImageFormatException(
SR
.Format(
SR
.UnexpectedSignatureTypeCode, typeCode));
145
throw new BadImageFormatException(
SR
.SignatureTypeSequenceMustHaveAtLeastOneElement);
316
throw new BadImageFormatException(
SR
.NotTypeDefOrRefHandle);
328
throw new BadImageFormatException(
SR
.NotTypeDefOrRefOrSpecHandle);
335
throw new BadImageFormatException(
SR
.Format(
SR
.UnexpectedSignatureHeader, expectedKind, header.Kind, header.RawValue));
344
throw new BadImageFormatException(
SR
.Format(
SR
.UnexpectedSignatureHeader2, SignatureKind.Property, SignatureKind.Method, header.Kind, header.RawValue));
System\Reflection\Metadata\IL\ILOpCodeExtensions.cs (6)
92
throw new ArgumentException(
SR
.Format(
SR
.UnexpectedOpCode, opCode), nameof(opCode));
164
throw new ArgumentException(
SR
.Format(
SR
.UnexpectedOpCode, opCode), nameof(opCode));
236
throw new ArgumentException(
SR
.Format(
SR
.UnexpectedOpCode, opCode), nameof(opCode));
System\Reflection\Metadata\IL\MethodBodyBlock.cs (8)
121
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidMethodHeader1, headByte));
128
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidMethodHeader2, headByte, headByte2));
149
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidLocalSignatureToken, unchecked((uint)localSignatureToken)));
162
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidSehHeader, sehHeader));
System\Reflection\Metadata\Internal\BlobHeap.cs (1)
193
throw new BadImageFormatException(
SR
.InvalidDocumentName);
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (2)
89
throw new ArgumentException(
SR
.Format(
SR
.InvalidConstantValueOfType, value.GetType()), nameof(value));
System\Reflection\Metadata\MetadataReader.cs (31)
93
Throw.InvalidArgument(
SR
.MetadataStringDecoderEncodingMustBeUtf8, nameof(utf8Decoder));
136
throw new BadImageFormatException(
SR
.Format(
SR
.ModuleTableInvalidNumberOfRows, this.ModuleTable.NumberOfRows));
182
throw new BadImageFormatException(
SR
.MetadataHeaderTooSmall);
188
throw new BadImageFormatException(
SR
.MetadataSignature);
203
throw new BadImageFormatException(
SR
.NotEnoughSpaceForVersionString);
246
throw new BadImageFormatException(
SR
.StreamHeaderTooSmall);
256
throw new BadImageFormatException(
SR
.NotEnoughSpaceForStreamHeaderName);
281
throw new BadImageFormatException(
SR
.NotEnoughSpaceForStringStream);
290
throw new BadImageFormatException(
SR
.NotEnoughSpaceForBlobStream);
299
throw new BadImageFormatException(
SR
.NotEnoughSpaceForGUIDStream);
308
throw new BadImageFormatException(
SR
.NotEnoughSpaceForBlobStream);
317
throw new BadImageFormatException(
SR
.NotEnoughSpaceForMetadataStream);
327
throw new BadImageFormatException(
SR
.NotEnoughSpaceForMetadataStream);
337
throw new BadImageFormatException(
SR
.NotEnoughSpaceForMetadataStream);
347
throw new BadImageFormatException(
SR
.NotEnoughSpaceForMetadataStream);
361
throw new BadImageFormatException(
SR
.InvalidMetadataStreamFormat);
436
throw new BadImageFormatException(
SR
.MetadataTableHeaderTooSmall);
467
throw new BadImageFormatException(
SR
.Format(
SR
.UnknownTables, presentTables));
478
throw new BadImageFormatException(
SR
.IllegalTablesInCompressedMetadataStream);
503
throw new BadImageFormatException(
SR
.TableRowCountSpaceTooSmall);
509
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidRowCount, rowCount));
539
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidEntryPointToken, entryPointToken));
549
throw new BadImageFormatException(
SR
.Format(
SR
.UnknownTables, externalTableMask));
781
throw new BadImageFormatException(
SR
.MetadataTablesTooSmall);
1055
throw new InvalidOperationException(
SR
.MetadataImageDoesNotRepresentAnAssembly);
1112
throw new InvalidOperationException(
SR
.StandaloneDebugMetadataImageDoesNotContainModuleTable);
System\Reflection\Metadata\MetadataReader.netstandard.cs (1)
77
throw new BadImageFormatException(
SR
.PEImageDoesNotHaveMetadata, assemblyFile);
System\Reflection\Metadata\MetadataReader.WinMD.cs (1)
658
throw new BadImageFormatException(
SR
.WinMDMissingMscorlibRef);
System\Reflection\Metadata\MetadataReaderProvider.cs (1)
172
throw new ArgumentException(
SR
.StreamMustSupportReadAndSeek, nameof(stream));
System\Reflection\Metadata\PEReaderExtensions.cs (2)
34
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidMethodRva, relativeVirtualAddress));
System\Reflection\Metadata\PortablePdb\ImportDefinitionCollection.cs (2)
123
throw new BadImageFormatException(
SR
.Format(
SR
.InvalidImportDefinitionKind, kind));
System\Reflection\Metadata\TypeNameParserHelpers.cs (10)
359
throw new ArgumentException(
SR
.Argument_InvalidTypeName, $"typeName@{errorIndex}");
366
throw new InvalidOperationException(
SR
.Format(
SR
.InvalidOperation_MaxNodesExceeded, limit));
377
throw new InvalidOperationException(
SR
.InvalidOperation_NotGenericType);
388
throw new InvalidOperationException(
SR
.InvalidOperation_NotNestedType);
399
throw new InvalidOperationException(
SR
.InvalidOperation_NoElement);
410
throw new InvalidOperationException(
SR
.Argument_HasToBeArrayClass);
421
throw new InvalidOperationException(
SR
.InvalidOperation_NestedTypeNamespace);
445
throw new InvalidOperationException(
SR
.Format(
SR
.Arg_NotSimpleTypeName, fullName));
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (1)
150
throw new BadImageFormatException(
SR
.InvalidTypeSize);
System\Reflection\PortableExecutable\DebugDirectory\DebugDirectoryBuilder.cs (1)
119
Throw.InvalidArgument(
SR
.ExpectedNonEmptyString, nameof(pdbPath));
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (2)
118
_ => throw new ArgumentException(
SR
.Format(
SR
.UnknownSectionName, name), nameof(name)),
System\Reflection\PortableExecutable\PEBuilder.cs (3)
79
throw new InvalidOperationException(
SR
.Format(
SR
.MustNotReturnNull, nameof(CreateSections)));
506
throw new InvalidOperationException(
SR
.SignatureProviderReturnedInvalidSignature);
System\Reflection\PortableExecutable\PEHeader.cs (1)
289
throw new BadImageFormatException(
SR
.UnknownPEMagicValue);
System\Reflection\PortableExecutable\PEHeaders.cs (10)
83
throw new ArgumentException(
SR
.StreamMustSupportReadAndSeek, nameof(peStream));
96
throw new BadImageFormatException(
SR
.InvalidPESignature);
107
throw new BadImageFormatException(
SR
.UnknownFileFormat);
256
throw new BadImageFormatException(
SR
.InvalidCorHeaderSize);
281
throw new BadImageFormatException(
SR
.UnknownFileFormat);
301
throw new BadImageFormatException(
SR
.InvalidPESignature);
311
throw new BadImageFormatException(
SR
.InvalidNumberOfSections);
347
throw new BadImageFormatException(
SR
.SectionTooSmall);
414
throw new BadImageFormatException(
SR
.MissingDataDirectory);
425
throw new BadImageFormatException(
SR
.InvalidMetadataSectionSpan);
System\Reflection\PortableExecutable\PEReader.cs (12)
165
throw new ArgumentException(
SR
.StreamMustSupportReadAndSeek, nameof(peStream));
361
throw new InvalidOperationException(
SR
.PEImageDoesNotHaveMetadata);
548
throw new BadImageFormatException(
SR
.InvalidDirectoryRVA);
553
throw new BadImageFormatException(
SR
.InvalidDirectorySize);
572
throw new BadImageFormatException(
SR
.InvalidDebugDirectoryEntryCharacteristics);
608
Throw.InvalidArgument(
SR
.Format(
SR
.UnexpectedDebugDirectoryType, nameof(DebugDirectoryEntryType.CodeView)), nameof(entry));
627
throw new BadImageFormatException(
SR
.UnexpectedCodeViewDataSignature);
648
Throw.InvalidArgument(
SR
.Format(
SR
.UnexpectedDebugDirectoryType, nameof(DebugDirectoryEntryType.PdbChecksum)), nameof(entry));
666
throw new BadImageFormatException(
SR
.InvalidPdbChecksumDataFormat);
829
throw new InvalidOperationException(
SR
.StreamMustSupportReadAndSeek);
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (10)
38
Throw.InvalidArgument(
SR
.Format(
SR
.UnexpectedDebugDirectoryType, nameof(DebugDirectoryEntryType.EmbeddedPortablePdb)), nameof(entry));
58
throw new BadImageFormatException(
SR
.Format(
SR
.UnsupportedFormatVersion, PortablePdbVersions.Format(formatVersion)));
64
throw new BadImageFormatException(
SR
.Format(
SR
.UnsupportedFormatVersion, PortablePdbVersions.Format(embeddedBlobVersion)));
76
throw new BadImageFormatException(
SR
.UnexpectedEmbeddedPortablePdbDataSignature);
87
throw new BadImageFormatException(
SR
.DataTooBig, e);
117
throw new BadImageFormatException(
SR
.SizeMismatch);
126
throw new BadImageFormatException(
SR
.SizeMismatch);
System\Reflection\Throw.cs (35)
29
throw new ArgumentException(
SR
.CantGetOffsetForVirtualHeapHandle, "handle");
35
throw new ArgumentException(
SR
.Format(
SR
.UnexpectedHandleKind, kind));
41
throw new ArgumentException(
SR
.InvalidHandle, parameterName);
47
throw new InvalidOperationException(
SR
.SignatureNotVarArg);
53
throw new InvalidOperationException(
SR
.ControlFlowBuilderNotAvailable);
59
throw new InvalidOperationException(
SR
.BuilderAlreadyLinked);
71
throw new InvalidOperationException(
SR
.Format(
SR
.LabelNotMarked, id));
77
throw new ArgumentException(
SR
.LabelDoesntBelongToBuilder, parameterName);
83
throw new ArgumentException(
SR
.NotMetadataHeapHandle, "handle");
89
throw new ArgumentException(
SR
.NotMetadataTableOrUserStringHandle, "handle");
95
throw new ArgumentException(
SR
.InvalidToken, "token");
107
throw new ArgumentException(
SR
.ExpectedNonEmptyString, parameterName);
113
throw new ArgumentException(
SR
.ExpectedNonEmptyArray, parameterName);
131
throw new ArgumentOutOfRangeException(parameterName,
SR
.BlobTooLarge);
155
throw new BadImageFormatException(
SR
.OutOfBoundsRead);
161
throw new InvalidOperationException(
SR
.OutOfBoundsWrite);
167
throw new BadImageFormatException(
SR
.InvalidCodedIndex);
173
throw new BadImageFormatException(
SR
.InvalidHandle);
179
throw new BadImageFormatException(
SR
.InvalidCompressedInteger);
185
throw new BadImageFormatException(
SR
.InvalidSerializedString);
191
throw new BadImageFormatException(
SR
.ImageTooSmall);
197
throw new BadImageFormatException(
SR
.ImageTooSmallOrContainsInvalidOffsetOrCount);
203
throw new BadImageFormatException(
SR
.RowIdOrHeapOffsetTooLarge);
209
throw new BadImageFormatException(
SR
.Format(
SR
.MetadataTableNotSorted, tableIndex));
215
throw new InvalidOperationException(
SR
.Format(
SR
.MetadataTableNotSorted, tableIndex));
221
throw new InvalidOperationException(
SR
.PEImageNotAvailable);
227
throw new BadImageFormatException(
SR
.TooManySubnamespaces);
233
throw new BadImageFormatException(
SR
.ValueTooLarge);
239
throw new BadImageFormatException(
SR
.SequencePointValueOutOfRange);
245
throw new ImageFormatLimitationException(
SR
.Format(
SR
.HeapSizeLimitExceeded, heap));